i noted that in rails 2.3.2 there is no more option to set which rails environment you are using. So i cannot just set it anymore in environment.rb? There is any other way to set it?
6 Answers
Maybe you mean in config/environment.rb?
I'm 90% sure you can just add the line there if you need it. And I'm wrong, see VP's comment below. (Tested and confirmed it)
1 Comment
im using rails 2.3.5 which should be similar to 2.3.2, and terry lorber is right,
RAILS_ENV=xyz is the exact way to lauch rails stuff with RAILS_ENV specifified from command line.
In this way, you can use rake, script/console script/runner script/server etc. in your different environments
Comments
I think it's a command line argument.
1 Comment
define in config/environments/production.rb or development.rb or whatever other modes you are running like stage.rb instead of writing/defining in config/environment.rb
I am using it and its serving my purpose. don't use the keyword RAILS_ENV (I haven't tried it) I am using it APP_MODE = "Production" In production environment file and APP_MODE = "Development" in development file.
then you can use this in your application to detect which mode you are in.
Hope, I answer the question