Rails is no longer a singleton, and multiple applications can be initialized in a single Ruby process. The caveat is that these applications will share a single global configuration which is stored in Rails.config
, which is created as soon as the first rails application is initialized.
This also means that Rails.config
is available before the environment initialization occurs.
You can now initialize multiple rails applications. To do this, I've changed the initialization of an application to the following structure (you can see this inside of /config/application.rb
).