title: Why can't I require a file in the parent directory in ruby?
body: <p>Note that I am not using Rails. I have a directory structure like:</p>
  
  <pre><code>foo/
  bar/
  base_classes/
  base_classes.rb
  </code></pre>
  
  <p>base_classes.rb:</p>
  
  <pre><code> Dir.glob(File.expand_path(File.join("base_classes/config/constants", "*.rb"))) { |file| require file}
   Dir.glob(File.expand_path(File.join("base_classes", "*.rb"))) { |file| require file}
  </code></pre>
  
  <p>when I am in this root directory</p>
  
  <pre><code>&gt;&gt; require 'base_classes' #=&gt; true
  &gt;&gt; Card.load!
  [stuff happens]
  </code></pre>
  
  <p>But when I am in foo/ and do either of the following:</p>
  
  <pre><code>&gt;&gt; require '../base_classes' #=&gt; true
  &gt;&gt; require File.expand_path("../base_classes.rb") #=&gt; true
  &gt;&gt; require File.expand_path("../base_classes") #=&gt; true
  &gt;&gt; Card.load!
  &gt;&gt; NameError: uninitialized constant Card
  </code></pre>