title: uninitialized constant error when run my rake task, why?
body: <p>I have a class which is NOT an ActiveRecord.
  the class is located under lib/room/</p>
  
  <p><strong>lib/room/car_painter.rb</strong></p>
  
  <pre><code>class ROOM::CarPainter
  
    def paint_car
      ...
    end
  
  end
  </code></pre>
  
  <p>Then, I have a rake task:
  under /lib/tasks/</p>
  
  <p><strong>/lib/tasks/new_car_painting.rake</strong></p>
  
  <pre><code>namespace :new_car do
  
    desc "Paint new cars"
    task :paint =&gt; :environment do
      painter = ROOM::CarPainter.new #ERROR HERE- uninitialized constant
      painter.paint_car
    end
  
  end
  </code></pre>
  
  <p>When I run <strong>rake new_car:paint</strong>, I got the error message "<strong>uninitialized constant ROOM::CarPainter</strong>", Why??</p>
  
  <p><strong>--EDIT--</strong>-</p>
  
  <p>I also tried to use class function instead of instance function, like following:</p>
  
  <pre><code>class ROOM::CarPainter
  
     def self.paint_car
          ...
     end
  
  end
  </code></pre>
  
  <p>and</p>
  
  <p>namespace :new_car do</p>
  
  <pre><code>  desc "Paint new cars"
    task :paint =&gt; :environment do
      ROOM::CarPainter.paint_car #ERROR HERE- uninitialized constant
    end
  
  end
  </code></pre>
  
  <p>But I get the same error message...why again</p>