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
source share