【问题标题】:Heroku scheduled job returns 'command not found' but works with a rakeHeroku 计划作业返回“找不到命令”,但可以使用 rake
【发布时间】:2012-11-16 20:09:33
【问题描述】:

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

当我做 rake 时,任务运行正常:

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

有什么想法吗?

谢谢!

【问题讨论】:

    标签: heroku scheduled-tasks http-get


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-11-15
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-17
      相关资源
      最近更新 更多