Running script/runner in production environment

Following from a previous post about email scheduling with runner and cron, it turns out that the runner default behaviour is to run in the development environment.

Although by reading the help for the script/runner, there is a suggestion to run it with the -e production added to the end, it doesn’t seem to be working.

The solution to make it running in the production environment was to delete the first line (shebang) from step 3 on this post

#!/usr/bin/env /path_to_your_app/script/runner

and then use the following in the cron setup:

RAILS_ENV=production /path/to/your_ror_project/script/runner /path/to/your_ror_project/lib/email_scheduler.rb

Have a look on paragraph Alternative Usage here

Dreamhost, Rails 2.1.1, Freeze, Capistrano

With the imminent upgrade in Dreamhost to Rails 2.1.1 (dreamhost blog post here), you may want to freeze your Rails version to a previous version, using capistrano.

On your local development pc freeze the rails:

rake rails:freeze:gems

Add the new code to your svn repository:

svn commit -m 'freeze rails'

And then deploy to dreamhost using capistrano:

cap deploy

Your rails project located on dreamhost should be frozen to your current Rails version.