Alex Rivera | Logout

How can I set RAILS_ENV to production for all subsequent rake commands?

Asked 2010-06-24T20:59:35.637
12

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.

Edit
Report

1 Answer

14

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 !

answered 2010-06-24T23:15:24.140

Your Answer