When is the environment.rb file loaded in a rails 3 app?
I dont' see any reference 开发者_运维问答to my environment.rb file in my rails 3 app, I must be not looking at the right place.
Is it called differenlty now, I thought it was in /public/dispatch.rb?
It's in config.ru
. This is a Rack-up file, that any Rack complient server will load when starting the app. It contains something like this:
require ::File.expand_path('../config/environment', __FILE__)
run YourApp::Application
The first line loads your environment. The second line tells the Rack server that your application is the Rack application to load.
精彩评论