Heroku预定的工作返回'命令未找到',但使用耙子

时间:2012-11-16 20:09:34

标签: heroku scheduled-tasks http-get

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

有什么想法吗?

谢谢!

1 个答案:

答案 0 :(得分:12)

听起来您将Heroku调度程序作业设置为send_notifications,而不是rake send_notificationsbundle exec rake send_notifications