我有一个 rake 任务,我想安排一个 cron 运行。我的 Rails 4 项目托管在运行 Ubuntu 12.10 (Nginx + Unicorn) 的 DigitalOcean droplet 上。
这是我在 crontab 中的内容:
SHELL=/bin/bash
PATH=/sbin:/bin/usr/bin
HOME=/
MAILTO="xxx@gmail.com"
* * * * * /bin/bash -l -c 'source ~/.bash_profile && cd /home/rails && RAILS_ENV=production bin/rake populate:fetch_nr_songs'
但是我收到此错误:
/etc/profile.d/rvm.sh: line 9: ps: command not found
/etc/profile.d/rvm.sh: line 10: ps: command not found
/usr/local/rvm/scripts/rvm: line 96: dirname: command not found
ERROR: Missing proper 'which' command. Make sure it is installed before using RVM!
任何修复将不胜感激谢谢