我正在尝试使用 Heroku 计划任务,该任务对特定控制器的操作进行 HTTP GET。这是任务的样子:
require 'net/http'
desc "This task is called by the Heroku scheduler add-on"
task :send_notifications => :environment do
Net::HTTP.get("http://testapp.com", "/test/send_notifications")
end
运行时:
heroku rake send_notifications
我收到以下错误:
rake aborted!
getaddrinfo: Name or service not known
/app/lib/tasks/scheduler.rake:5:in `block in <top (required)>'
有什么想法吗?
提前致谢