Rails 3, 4, 5, 6
config/application.rb
-
config/environment.rb
before theinitialize!
call (we don't usually edit this file) - The current environment, e.g.
environments/production.rb
- Gems
- Vendored plugins
- All initializers in
config/initializers/*.rb
-
config/environment.rb
after theinitialize!
call (we don't usually edit this file) - Your own code from
app
Rails 2
- Code in
config/preinitializer.rb
(if it exists) -
environment.rb
, code above theRails::Initializer.run
block (put constants here if you want to override them in environments) -
environment.rb
, theRails::Initializer.run
block - The current environment, e.g.
environments/production.rb
- Gems
- Vendored plugins
- All initializers in
config/initializers/*.rb
- Code below the
Rails::Initializer
block
Further reading
Consider reading the Rails initialization process guide Show archive.org snapshot for a deep dive into the initialization process.
Posted by Henning Koch to makandra dev (2010-09-07 10:08)