RAILS_ENV and rails 2.3.2

i noted that in rails 2.3.2 it is no longer possible to establish which rail environment you are using. So I can’t just install it in environment.rb? Is there any other way to install it?

+4
source share
6 answers

I think this is a command line argument.

0
source

RAILS_ENV=production rake db:migrate

What exactly are you trying to run? Rail generator? Greyk problem? Watchdog? I am not sure if this is a Rails issue.

Disclaimer: I did not use 2.3.2, however.

+3
source

Perhaps you mean config/environment.rb ?

I'm 90% sure that you can just add a line there if you need it. And I'm wrong , see the comment on VP below. (Tested and confirmed)

+1
source

im using rails 2.3.5, which should be similar to 2.3.2, and the sailor lorber is right,

RAILS_ENV = xyz is the exact way to use lauch rails with the RAILS_ENV specified on the command line.

This way you can use rake, script / console script / runner script / server, etc. in different environments

+1
source

define in config / environment / production.rb or development.rb or in other modes that you use, for example stage.rb, instead of writing / defining in config / environment.rb

I use it and it serves my purpose. do not use the keyword RAILS_ENV (I have not tried it) I use it APP_MODE = "Production" in the production environment file and APP_MODE = "Development" in the development file.

then you can use this in your application to determine which mode you are in.

I hope I answer the question

0
source

If you want to run the application in development,

 ruby script/server 

To get started,

 ruby script/server -e production 
0
source

All Articles