Rails 3 app server startup time is long

前端 未结 3 700
遇见更好的自我
遇见更好的自我 2021-02-04 04:08

UPDATE 2 This is a known bug/feature with the way Ruby 1.9.2 loads files. http://twitter.com/#!/rails/status/72801149769621504

update:

3条回答
  •  天涯浪人
    2021-02-04 04:32

    Bundler often spends more than half of its time requiring gems. Are any of the dependencies that you are loading unnecessary in dev/test mode? For instance, some of my gems are only used by resque workers or in other scripts. You can add :require => false and then manually require them when you need them for some modest startup speed gains in dev/test mode.

    Before doing so, I usually profile the require statements (in lib/bundler/runtime.rb) to see if they're actually worth taking out.

提交回复
热议问题