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

2 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’

Add Your Comment



(optional)