上帝不会启动 Resque 工人:耙子中止!非绝对的家

发布于 2024-11-05 17:18:20 字数 344 浏览 1 评论 0原文

我在 log/resque-0.log 中收到以下错误:

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

如果我使用上帝使用的相同命令手动启动一个工作程序,它启动得很好:

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

我尝试在“rails”用户下运行该命令,并且“root”用户(上帝在其下运行)。有什么想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

萌吟 2024-11-12 17:18:20

你在“Rakefile”和“resque”之间有一个额外的环境

我的上帝脚本通常看起来像这样:

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'

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'
笙痞 2024-11-12 17:18:20

所以问题的一部分是shadow_puppet试图解决你的路径,但如果你实际上正在尝试使用shadow_puppet或其他尝试扩展〜上路径的东西(例如Capistrano),请确保包括:

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

这为我解决了这个问题情况(来自上帝监控的resque工人的驾驶帽)。

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).

喵星人汪星人 2024-11-12 17:18:20

好吧,结果我只需要从 Gemfile 中删除 Shadow_puppet 即可。不知道为什么我一开始就把它放在那里,也许它是旧版本的 Moonshine 的遗留物。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文