Setting the RAILS_ENV for workling_client

Today I spent some hours on fixing our background emailing queue for eventize.de. We’re having a staging system running on the same server, each with a Starling MemCache interfaced queue

Workling should get the items from the queue and send them out. It ran into the problem to not finding the RAILS_ENV.

The solution was as easy as this:

run "export RAILS_ENV='#{rails_env}' && #{latest_release}/script/workling_client start "

If you find youself in this situation: Don’t just write in environment.rb:

ENV['RAILS_ENV'] ||= 'production'

It will annoy you later - for sure ;)

Leave a Reply