I know this is trivial, but if you are new to RoR, you may get confused, coz they all come in different shapes and sizes.

For mongrel (other options taken out for clarity purpose):

mongrel_rails start -e production

For rake command:

rake [task] RAILS_ENV=production

For ruby console:

ruby script/console production

5 Comments . Comments Feed . Trackback URI
Sun, 6 Jan 08 01:49 am . pick wrote:

actually that was useful for running my rake task in production. i don’t understand why the environment file doesn’t automatically set the environment for your rake tasks though.

Sun, 6 Jan 08 09:26 am . Herryanto Siatono wrote:

@pick, yeah, you can force the default enviornment to production environment in your config/environment.rb file if you want to.

ENV[’RAILS_ENV’] ||= ‘production’

Sat, 28 Jun 08 05:12 pm . Martin wrote:

Thanks! I was wondering why “./script/server RAILS_ENV=production” didn’t work! :-D

Sun, 4 Oct 09 06:37 am . André Moreira wrote:

Thanks for the tip old man!

:-)

Tue, 16 Aug 11 03:41 pm . Bernard Banta wrote:

How do you configure the production environment in rails 3.

Add Your Comment



(optional)