Rails initializes extremely slow on ruby 1.9.1

后端 未结 2 1105
旧巷少年郎
旧巷少年郎 2021-01-01 13:58

I just got my rails 2.3.8 app running on ruby 1.9.1. To get into the console, start the webserver, anything that initializes rails, takes 3 - 4 times longer in ruby 1.9 than

2条回答
  •  既然无缘
    2021-01-01 14:42

    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

提交回复
热议问题