Rake Cron工作错误 [英] Rake Cron job error

查看:197
本文介绍了Rake Cron工作错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


0/5 * * * * / bin / bash -l -c'cd / home / mss / ruby​​ / example && RAILS_ENV = development / usr / local / bin / bundle exec rake check_me_out --silent >> /tmp/cron_log.log 2>&1'



上面的cron引发错误bash:bundle:command not found ... p>

命令在命令行下可以正常工作



任何帮助都会感激。

解决方案


好​​,所以我得到这个工作。 Cron不加载配置文件设置。我必须加载bash_profile作为命令的一部分,现在它可以工作。




0/5 * * * * / bin / bash -l -c 'source〜/ .bash_profile && cd / home / mss / ruby​​ / example && RAILS_ENV = development bin / rake check_me_out --silent >> /tmp/cron_log.log 2>&1'


0/5 * * * * /bin/bash -l -c 'cd /home/mss/ruby/example && RAILS_ENV=development /usr/local/bin/bundle exec rake check_me_out --silent >> /tmp/cron_log.log 2>&1'

Above cron throws an error "bash: bundle: command not found..."

The command works just fine from the command line

Any help will be appreciated.

解决方案

Okay so I got this working. Cron does not load the profile settings. I had to load the bash_profile as part of the commands and now it works.

0/5 * * * * /bin/bash -l -c 'source ~/.bash_profile && cd /home/mss/ruby/example && RAILS_ENV=development bin/rake check_me_out --silent >> /tmp/cron_log.log 2>&1'

这篇关于Rake Cron工作错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆