If you have rake tasks that don't rely on rails, it's really annoying that rails has to load before the tasks runs.
Instead this rakefile only loads rails if a rake task which depends on :environment is called.
- Added a call to Rake::Application#clear before loading the rails environment so that tasks are not called twice, and so that tasks can be called again.
One caveat is that rake -T won't list rails/gem tasks, hence the added warning. To show all tasks use rake -T LOAD_RAILS=1
With thanks to @xshay http://rhnh.net/2010/09/07/speeding-up-rails-rake
Any thoughts?