Cron的工作没有使用Capistrano&每当

时间:2014-02-03 21:18:04

标签: ruby-on-rails

我很难过这个。我正在使用capistrano和gems来管理我的构建以生产。 Cron正在正确设置。当我看到'crontab -e'时,我看到......

# Begin Whenever generated tasks for: nso
10 * * * * /bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1'

......这看起来很正确。在/ var / log / syslog中我看到......

Feb  3 16:10:01 vweb-nso CRON[32186]: (user) CMD (/bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1')
Feb  3 16:10:01 vweb-nso postfix/pickup[31636]: 8A67B805C7: uid=1001 from=<user>
Feb  3 16:10:01 vweb-nso postfix/cleanup[32191]: 8A67B805C7: message-id=<20140203211001.8A67B805C7@vweb-nso>
Feb  3 16:10:01 vweb-nso postfix/qmgr[31637]: 8A67B805C7: from=<user@abtech.edu>, size=712, nrcpt=1 (queue active)
Feb  3 16:10:01 vweb-nso postfix/local[32193]: 8A67B805C7: to=<user@abtech.edu>, orig_to=<user>, relay=local, delay=0.03, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Feb  3 16:10:01 vweb-nso postfix/qmgr[31637]: 8A67B805C7: removed

一切看起来还不错......没有?

另外我可以手动运行命令。在命令提示符处,如果我这样做。

/bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1'

...我得到了我应该提醒的电子邮件。我错过了什么?

1 个答案:

答案 0 :(得分:0)

所以这最终成了我的问题......

Rails cron whenever, bundle: command not found

一旦我将env:PATH,ENV ['PATH']添加到config / schedule.rb的顶部,一切都按宣传的方式工作!