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 !
I tend to want to set it conscientiously with each command also.
Although I don't do much directly on the server, I'm usually using capistrano. So if I was working directly on the server a lot, I might want to set it permanently. Which, BTW, Larry didn't mention how to do:
$ RAILS_ENV=production
$ rake foo
$ rake bar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With