【发布时间】:2016-01-16 01:26:21
【问题描述】:
我正在运行一个 Rails 服务器,它定期运行 rake task,无论何时使用 gem 和 cron。
我可以使用这些成功运行rake task。在我的远程服务器上,我以 root 身份运行它。第二次尝试也有效。
RAILS_ENV=production rake fetch_myitems
// attempt 1
//attempt 2
/bin/bash -l -c 'cd /home/rails/AniKawaii && RAILS_ENV=production bundle exec rake fetch_animegifs --silent >> log/whenever.log 2>&1'
调试后,这就是我最终发现的错误来源。我知道这与 database.yml 有关。但是我可以成功部署到我的实时生产服务器并且调用RAILS_ENV=production rake fetch_myitems 不会触发此错误,所以我不知道该怎么做。
PG::ConnectionBad: fe_sendauth: no password supplied
crontab -l
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/rails/AniKawaii && RAILS_ENV=production bundle exec rake fetch_animegifs --silent >> log/whenever.log 2>&1'
【问题讨论】:
标签: ruby-on-rails ruby cron whenever