我有一个Heroku预定的工作,应该每10分钟运行一次。它只是向控制器的动作发出一个HTTP GET请求,它做了一些事情。
desc "This task is called by the Heroku scheduler add-on"
task :send_notifications => :environment do
response = HTTParty.get('http://sendnotificationapp.com/sms/send_notifications')
end
当我做耙子时,任务运行并正常运行:
heroku rake send_notifications
虽然当我使用Heroku调度程序GUI将其设置为每10分钟运行一次时,它不会运行。相反,我收到以下错误:
Starting process with command `send_notifications` by scheduler@addons.heroku.com
Starting process with command `send_notifications`
bash: send_notifications: command not found
Process exited with status 127
有什么想法吗?
谢谢!
答案 0 :(得分:12)
听起来您将Heroku调度程序作业设置为send_notifications
,而不是rake send_notifications
或bundle exec rake send_notifications
。