Blankman
Blankman

Reputation: 266960

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?

Upvotes: 1

Views: 702

Answers (1)

iain
iain

Reputation: 16274

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.

Upvotes: 2

Related Questions