Rails initializes extremely slow on ruby 1.9.1 Rails initializes extremely slow on ruby 1.9.1 ruby ruby

Rails initializes extremely slow on ruby 1.9.1


Try using 1.9.2-head instead of 1.9.1. It is the recommended version for Rails 3, so you may have better luck. Rails 2.3.8 starts up very quick on 1.9.2-head from the tests I just ran locally (with Authlogic installed too, btw).

If you are using RVM, type the following:

rvm install 1.9.2-headrvm use 1.9.2-head

Edit: I tried 1.9.1 p378 with the same app and the start up time took about 13 seconds compared to 5 seconds on 1.9.2-head. 1.9.2-rc1 is due out this month I believe, so that's good news :)


It's probably because ruby 1.9 uses gem_prelude (which gives you a large load path) instead of normal rubygems. Checkout the length of $: -- that gets searched once for each require, causing extra time

If you want it the old way, (upgrade to the latest version of rubygems and) run ruby --disable-gems

If you are on windows, take a look into my faster_require gem.

http://github.com/rdp/faster_require

Though I suppose, now that you mention it, it might help in 1.9 Linux. Maybe.

GL!-rp