All you need is access to the RAILS_ENV constant. For example this script -- x.rb-- puts RAILS_ENV ----
When run produces the following output: $ ruby script/runner -e production x.rb production $ ruby script/runner -e development x.rb development $ ruby script/runner -e test x.rb test for any environment that you have defined. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

