1

I'm getting the following error in log/resque-0.log:

rake aborted!
non-absolute home
/srv/myapp/current/Rakefile:4

If I start a worker manually using the same command God uses, it starts up just fine:

QUEUE=* RAILS_ENV=production /usr/bin/rake -f /srv/myapp/current/Rakefile environment resque:work

I've tried running that command under the 'rails' user and the 'root' user (which God runs under). Any ideas?

Jarin Udom
  • 1,849
  • 3
  • 19
  • 23
  • It looks like the problem may be in your Rakefile, please post your Rakefile and god script. – Gazler May 09 '11 at 21:12

3 Answers3

1

you have an extra environment in yours between "Rakefile" and "resque"

My god scripts usually look like this:

rails_env = ENV['RAILS_ENV'] || "development"
rails_root = ENV['RAILS_ROOT'] || "/path/to/app"


God.watch do |w|
    w.name = "resque-task"
    w.group = 'resque'
    w.interval = 30.seconds
    w.start = "/path/to/rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"

    w.uid = 'gazler'
    w.gid = 'gazler'
Gazler
  • 83,029
  • 18
  • 279
  • 245
  • Didn't seem to fix the problem. It runs great when I start it on the server via SSH, but it's failing when god tries to run it (same error). – Jarin Udom May 09 '11 at 23:11
1

So part of the problem is shadow_puppet trying to resolve your path, but if you're actually trying to use shadow_puppet or something else that tries to expand path on ~ (like Capistrano for example) make sure to include:

w.env = {"HOME" => "/users/home/dir"}

That fixed this problem for my situation (driving cap from a god-monitored resque worker).

Mat Schaffer
  • 1,634
  • 1
  • 15
  • 24
0

Ok turns out I just had to remove shadow_puppet from my Gemfile. Not sure why I had it in there in the first place, maybe it was a holdover from an old version of Moonshine.

Jarin Udom
  • 1,849
  • 3
  • 19
  • 23