I'm trying to create a new environment (build) for using it with hudson.
I'm doing this because I didn't want to mix up my test databases with hudson test database.
You cannot switch environments once Rails has been loaded in a process (for server, console, tests, rake tasks,...). You need to specify the environment when launching the process, and cannot change it afterwards. Stop the process, and start again with another environment if you need it.
Assuming you want create the hudson
environment.
config/environments/hudson.rb
. You can start by cloning an existing one, for instance config/environments/test.rb
.config/database.yml
for your environment.config
folder with your new environment, some gems create their own ymls
under the config
folder.Now you can start the server
rails server -e hudson
or run the console
rails console hudson
And so on.
If you are using an older version of Rails, the commands are
ruby script/server -e hudson ruby script/console hudson
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With