As a bonus how do I set this in a config, so that when I log into my production server I don't have to retype it.
in your .bashrc, put:
if [[ $- != *i* ]] ; then # Shell is non-interactive. Be done now! return fi export RAILS_ENV=production
Be careful, you will always be in production mode when you login !