【问题标题】:(CRON) error (grandchild #26321 failed with exit status 127)(CRON) 错误(孙#26321 失败,退出状态为 127)
【发布时间】:2013-03-30 10:40:00
【问题描述】:

我正在使用whenever gem我的 schedule.rb 内容是

每 2 分钟跑步一次 "炼油厂::Page.update_publishing_date_to_list_in_menu" 结束

我通过 crontab -l 得到这个

# Begin Whenever generated tasks for: /home/harssh/Documents/Aptana Studio 3 Workspacwinbox/wineboxnew/config/schedule.rb

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58
* * * * /bin/bash -l -c 'cd /home/harssh/Documents/Aptana\ Studio\ 3\ Workspacwinbox/wineboxnew && RAILS_ENV=production bundle exec rake page:publish --silent'

# End Whenever generated tasks for: /home/harssh/Documents/Aptana Studio 3 Workspacwinbox/wineboxnew/config/schedule.rb

这在我的 ubuntu 10.10 上运行良好

但是我在我的 debian 服务器上得到了(CRON) error (grandchild #26321 failed with exit status 127) 我使用 Ruby 1.9.3 使用 apache 和带有 rvm 的乘客

如果我在 debian 的终端中使用脚本,它也可以正常运行,但自动 cron 任务会出错

【问题讨论】:

  • /log/cron.log 中的任何内容?
  • 大声笑,它可能只是*/2 ...127 问题缺少命令 - 很可能是PATH 问题...
  • 此页面的tile是日志文件Vadim的内容
  • 是的 mpapis 假定 127 是路径错误我给出了所有可能的路径并设置了环境,但它总是给出 127 错误
  • 我想知道是否有特定的方法来提供我可能缺少的路径

标签: ruby-on-rails cron rvm passenger


【解决方案1】:

我也遇到了同样的问题,终于解决了这个问题。

问题 1: 脚本/运行程序文件中的 Ruby 路径

脚本/运行器文件中的 ruby​​ 路径:

#!/usr/local/bin/ruby

您可以将 (/usr/local/bin/ruby) 替换为您的机器 ruby​​ 路径。您可以在您的机器中使用以下命令检查 ruby​​ 路径:

哪个红宝石

问题2:我认为你的runner没有执行权限。

您可以通过以下方式设置运行器文件的执行权限:

Ruby 项目路径/脚本> chmod +x ruuner

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-08
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-02
    相关资源
    最近更新 更多