Forum: Ruby on Rails New Environment?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
11bd67aedc131020a51440fad59116cc?d=identicon&s=25 Andrew Filipowski (Guest)
on 2006-02-24 16:52
(Received via mailing list)
Hello all,
I was wondering if it is possible to create a new environment? IE I
want a fourth environment set called Stage. The reason being is that
we want to run a staging server of sorts. This server will run a copy
of our app that is rebuilt via switchtower every hour. We don't want
it to run in as test we want it to run as a production environment
but some of our classes rely on a variable set in the environments/
environment.rb (where the second environment is either test,
development, or production) file specific to the server they are
running on. We have a different variable set for production,
development, and test and would like to add the new environment
called stage.rb. Is it as easy as creating a new database definition
in the yml file called stage, and adding in a stage.rb file. Or is it
more difficult than that? Obviously we would tell lighty what
environment it is supposed to load.

Thanks for the help.

Andrew
6578456ff00ab3520b1fe684bc572b45?d=identicon&s=25 Łukasz Piestrzeniewicz (Guest)
on 2006-02-24 16:58
(Received via mailing list)
On 24/02/06, Andrew Filipowski <a.filipowski@mac.com> wrote:
> development, and test and would like to add the new environment
> called stage.rb. Is it as easy as creating a new database definition
> in the yml file called stage, and adding in a stage.rb file. Or is it
> more difficult than that? Obviously we would tell lighty what
> environment it is supposed to load.

It is just as simple as you say. Just make a copy of one of the files
in config/environments with a  new name, provide additional entry in
database.yml. and make sure that RAILS_ENV has new value.
This topic is locked and can not be replied to.