0

我有一个 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!

任何修复将不胜感激谢谢

4

1 回答 1

0

似乎 RVM 安装有问题。尝试重新安装它https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm

注意:您可以随时随地轻松管理crontab使用

于 2013-12-22T09:50:19.177 回答