title: After upgrading to Rails 3.2 my rake tasks are broken
body: <p>After upgrading to Rails 3.2 my rake tasks can't autoload models anymore.</p>
  
  <p>The following was working in rails 3.1:</p>
  
  <pre><code>09:04:14 /srv/www/gamersmafia/current$ rake --trace gm:update_default_skin_styles
  rake aborted!                                                                   
  No such file to load -- notification                                            
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:317:in `depend_on'
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:225:in `require_dependency'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:439:in `eager_load!'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:438:in `each' 
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:438:in `eager_load!'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:436:in `each' 
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:436:in `eager_load!'
  /srv/www/gamersmafia/current/lib/tasks/update_games_and_factions_sprite.rake:1
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load'
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load'
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
  /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:425:in `load_tasks'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:425:in `each' 
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:425:in `load_tasks'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/application.rb:145:in `load_tasks'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `send'
  /usr/lib/ruby/gems/1.8/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
  /srv/www/gamersmafia/current/Rakefile:7                                         
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `load_rakefile'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `run' 
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
  /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33                            
  /usr/local/bin/rake:19:in `load'                                                
  /usr/local/bin/rake:19
  </code></pre>
  
  <p>The code for my app is open sourced so you can check it here:</p>
  
  <pre><code>https://github.com/slnc/gamersmafia
  </code></pre>
  
  <p>The only modification I have done is to add a</p>
  
  <p>"Rails.application.eager_load!" line to the beginning of the rake task shown above. Without it it wouldn't load the "Skins" library.</p>
  
  <p>UPDATE
  I tried debugging this by adding puts statements on each line of the stack trace shown above and I can see something like this:</p>
  
  <pre><code>eager_load_path: /srv/www/gamersmafia/current/app/mailers
  file found: /srv/www/gamersmafia/current/app/mailers/notification.rb
  require_dependency notification
  ... notification
  rake aborted!
  </code></pre>
  
  <p>Which roughly seems to indicate that rails is finding the notification.rb file but when it tries to load it it can't.</p>