【发布时间】:2011-11-26 20:47:12
【问题描述】:
当使用 'whenever gem' 时,我在日志中得到一个错误:
/usr/bin/env: ruby: No such file or directory
当我手动运行作业时它可以工作。我已经用 RVM 安装了所有东西。
我使用which 命令找到了我的 Ruby 安装位置,我得到了:
kevin@lovely:/opt/personal$ which ruby
/home/kevin/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
我检查了我的 $PATH 变量,它返回的位置:
kevin@lovely:/opt/personal$ echo $PATH
/home/kevin/.rvm/gems/ruby-1.9.2-p290/bin:/home/kevin/.rvm/gems/ruby-1.9.2-p290@global/bin:/home/kevin/.rvm/rubies/ruby-1.9.2-p290/bin:/home/kevin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
我认为这应该设置正确,但我可能错了,因为它不起作用。谁能指出我正确的方向?
如果你有兴趣,这就是我每次 crontab 输出的内容:
# Begin Whenever generated tasks for: rss
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /opt/personal && script/rails runner -e development '\''FeedEntry.update_from_feed("http://lovely/blog/feed/")'\'' >> /opt/personal/log/feedzirra.log 2>&1'
【问题讨论】:
标签: ruby-on-rails-3 cron rvm whenever