Setting environment for script/runner

Posted by theBlatherskite Wed, 04 Apr 2007 00:16:00 GMT

Looking for a way to set the rails environment for your script/runner cron jobs? I wasn’t, until yesterday at 6:30 PM when I updated my rails gem. Suddenly

/script/runnner -e production System.some_method

(which had been working fine) started throwing errors, which meant I had to endure cron yelling at me periodically until I found a fix. It was surprisingly difficult to locate information about such a simple issue, but I finally came across somebody with the info I needed.

The new, functioning form:

RAILS_ENV=production ./script/runner System.some_method

As a side note, is also works for setting the environment in script/console and, presumably, wherever else you’d need it.

Posted in ,  | Tags , , ,  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment