rails/rails — Issue #4591: $rails_rake_task not set correctly
Author: jviney
Created: 2012-01-21 23:30:02+00:00
State: open

I am having trouble with a Rails 3.2 application always eager loading the application, even during a rake task. Previously, the `$rails_rake_task` variable was used by Rails to prevent this happening during startup.

Since 8ef1ec427f75a3ca2a2c19737a057ad3f354a9bd the value of `$rails_rake_task` is always set to nil.

During startup the value is set to true by `Rails::Application#initialize_tasks`, but at least in the startup of this app `rails/application/finisher.rb` is loaded after `#initialize_tasks` is called, and sets the value back to nil.

I've attached a different fix for the global variable warning that doesn't cause this problem.