I must admit, I'm cheating here a little. This advice is from Deploying Rails Applications by Ezra Zygmuntowicz (Pragmatic Programmers, 2008) pp54-55.
According to the book there are three ways to set the RAILS_ENV variable for your application.
1. This first solution is considered the best.
Open up the ~/.bashrc file
Add the line
2. Or you could set the environment in your web server config file, perhaps using a local .htaccess file on Apache.
3. Or you could edit environment.rb, commenting out the line you mentioned:
ENV['RAILS_ENV'] ||= 'production'
I hope that helps.