Rails 3 initializers that run only on `rails server` and not `rails generate`, etc
问题 I have a relatively small piece of initializer code that I want to run whenever rails server runs, but not when I run rails generate , rails console or any other rails command (including rake tasks that require the environment task). This piece of code pre-fills some caches and is relatively expensive so I really don't want it to run on anything but rails s Solutions that are unsatisfactory: Foreman et al. will mean it'll run on a different process which is (a) over the top for that small