Speeding up Rails Initialization
Chad Wooley just posted a tip to get rails starting up faster. Which is real, except it doesn’t work if you’re using ActiveScaffold. This is due to a load ordering problem – ActiveScaffold monkey patches the Resource class used by routes after routes have been parsed the first time, and relies on the re-parsing triggered by the inflections change.
To fix this, you can explicitly require the monkey patch just before you draw your routes (it doesn’t depend on anything else in ActiveScaffold).
1 2 3 4 5 6 7 |
# config/routes.rb ActionController::Routing::Routes.draw do |map| # Explicitly require this, otherwise it won't get loaded before we parse our resources time require 'vendor/plugins/active_scaffold/lib/extensions/resources.rb' # Your routes go here... end |
Yes it’s a hack on top of hack, but I get my console 30% quicker, so I’m running with it.
Tested on 2.0.2
December 15, 2012 at 3:13 PM
Hey, I have been reading this article, the link doesn't work anymore,
however i am using rails_admin and I would like to know if I could do something similar to speed up booting rails a bit.
December 20, 2012 at 1:20 AM
No, this was for a way old version of Rails, it's no longer appropriate.
Maybe start at Speeding Up Rails Startup Time and finish at Skaes' RVM patchsets