我正在尝试在heroku上加载一个简单的ruby应用程序,它定期使用resque运行后台任务,resque检查电子邮件帐户。它在本地与工头一起工作正常,但在heroku上不断崩溃。
我想也许Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
来自我的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
我的Procfile:
web: bundle exec ruby smsnotify.rb -p $PORT
resque: env TERM_CHILD=1 bundle exec rake jobs:work
smsnotify.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
答案 0 :(得分:0)
您没有启动绑定到端口的进程,因此抱怨。
您只需将Procfile更改为'worker'而不是'web'
如果你有一个网络前端,那么你将需要一个工人和一个网站