gpt4 book ai didi

ruby 应用程序在 heroku 上崩溃 : Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

转载 作者:太空宇宙 更新时间:2023-11-03 16:53:29 25 4
gpt4 key购买 nike

我正在尝试在 heroku 上加载一个简单的 ruby​​ 应用程序,该应用程序使用 resque 定期运行后台任务,它会检查电子邮件帐户。它在本地与工头一起工作正常,但在 heroku 上不断崩溃。

我认为 Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 来 self 的 while 循环,它是永久性的,因此超过 60 秒?我应该使用某种不同类型的进程来启动 smsnotify.rb 吗?

如有任何帮助,我们将不胜感激!

我的 heroku 日志:

2013-04-06T20:49:15+00:00 heroku[slugc]: Slug compilation finished
2013-04-06T20:49:18+00:00 heroku[web.1]: Starting process with command `bundle exec ruby smsnotify.rb -p 9129`
2013-04-06T20:49:21+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.0/lib/active_support/multibyte.rb:26: warning: already initialized constant VALID_CHARACTER
2013-04-06T20:50:19+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2013-04-06T20:50:19+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-04-06T20:50:20+00:00 heroku[web.1]: Process exited with status 137
2013-04-06T20:50:20+00:00 heroku[web.1]: State changed from starting to crashed

我的文件:

web: bundle exec ruby smsnotify.rb -p $PORT
resque: env TERM_CHILD=1 bundle exec rake jobs:work

短信通知.rb:

require "./email_checker"
require 'hirefire'
require 'resque'
Resque.redis = 'redis://redistogo:removed:removed/'
HireFire::Initializer.initialize!

while true do
Resque.enqueue(EmailChecker)
sleep 30
puts "Starting Email Job"
end

最佳答案

您没有启动绑定(bind)到端口的进程,所以它在提示。

您只需要将您的 Procfile 更改为“worker”而不是“web”

如果你有一个 web 前端,那么你将需要一个 worker 和一个 web

关于ruby 应用程序在 heroku 上崩溃 : Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15845803/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com