3
我有一些麻煩得到神的寶石啓動和運行。我基本上從Github複製配置文件,但它似乎並沒有正確啓動resque工作。我的配置文件如下所示:「上帝」不開始resque工人
rails_env = "production"
rails_root = "/path/to/root"
num_workers = 1
num_workers.times do |num|
God.watch do |w|
w.dir = "#{rails_root}"
w.name = "emailer-#{num}"
w.group = 'emailer'
w.interval = 30.seconds
w.behavior(:clean_pid_file)
w.env = {"QUEUE"=>"emailer", "RAILS_ENV"=>rails_env}
w.start = "/usr/local/bin/rake -f #{rails_root}/Rakefile environment resque:work"
end
end
而且我跑神用下面的命令:
sudo god -c resque.god -D
這給了我下面的輸出:
I [2012-08-15 19:32:00] INFO: resque.god
I [2012-08-15 19:32:00] INFO: Syslog enabled.
I [2012-08-15 19:32:00] INFO: Using pid file directory: /var/run/god
I [2012-08-15 19:32:00] INFO: Socket already in use
I [2012-08-15 19:32:01] INFO: Socket is stale, reopening
I [2012-08-15 19:32:01] INFO: Started on drbunix:///tmp/god.17165.sock
I [2012-08-15 19:32:01] INFO: emailer-0 move 'unmonitored' to 'up'
I [2012-08-15 19:32:01] INFO: emailer-0 moved 'unmonitored' to 'up'
但是,沒有工人曾經出現在resque-web界面中,並且沒有任何工作從隊列中拉出來。任何人都可以發現我做錯了什麼嗎?另外,我已經嘗試使用通常的腳本從命令行啓動一個worker,並且按預期工作。哦,這個運行在Ubuntu上10.04