The default value for RAILS_ENV is set to "development" in initializer.rb, which is loaded right after boot.rb has determined the boot strategy. I created a "config/preinitializer.rb" which was supposed to provide another default value for RAILS_ENV ("staging" or "production", depending on the host), but it doesn't work in all cases. Specifically, commands executed by "console", "dbconsole", "runner" and "server" scripts all set RAILS_ENV to "development" as default and ruins my preinitializer idea since these scripts happen before the actual initialization phase.
The workaround right now is to hardcode the RAILS_ENV value in preinitializer.rb without respecting the ENV["RAILS_ENV"] variable, but that disables the possiblity that I actually start the app in some custom environment other than what I wanted to hardcode for this host. What I would like to do is remove the "development" default from script/console, script/runner and script/server (removing it from "dbconsole" is not possible since it doesn't load the environment) and unless anyone can find an objection to this, I will be posting a patch. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---