title: How to require a class file in Rails 3 /lib directory from another class in /lib
body: <p>I am new to Ruby and Rails and am having trouble getting a class in /lib to reference another class in /lib.  </p>
  
  <p>I have this in my application.rb file, as I understand Rails 3 does not auto-load the lib directory:</p>
  
  <pre><code>    config.autoload_paths += %W(#{config.root}/lib)
  </code></pre>
  
  <p>Then I have lib/Rec.rb</p>
  
  <pre><code>class Rec
    Movie @movie
  ...
  </code></pre>
  
  <p>and then lib/Movie.rb.  I am able to instantiate a Movie object in a controller, but referencing in Rec produces:</p>
  
  <pre><code>undefined method `Movie' for Rec:Class
  ...
  lib/rec.rb:2:in `&lt;class:Rec&gt;'
  lib/rec.rb:1:in `&lt;top (required)&gt;'
  </code></pre>