【发布时间】:2015-07-06 21:43:30
【问题描述】:
我有一个运行 rails 4.2、ruby 2.2.2 的 rails 应用程序。应用程序在 Dev 中运行良好。但是当我上传到heroku时,我得到了这个。它在 Heroku 上运行,然后我在应用程序中添加了一些页面,现在我明白了。另外,为什么heroku服务器似乎按照我的Procfile启动了Puma服务器,然后又求助于WEBrick?
2015-07-06T05:53:18.502200+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T05:53:18.502200+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T05:53:19.595264+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T05:53:19.522763+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T05:53:22.172217+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-temple-3871.herokuapp.com request_id=160dd22d-0149-4427-825e-0cfe187d50f0 fwd="71.198.39.241" dyno= connect= service= status=503 bytes=
2015-07-06T06:58:38.061909+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T06:58:43.330632+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T06:58:48.463218+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T06:58:48.463238+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T06:58:48.463240+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T06:58:48.463241+00:00 app[web.1]: [3] * Environment: production
2015-07-06T06:58:48.463242+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T06:58:48.463245+00:00 app[web.1]: [3] * Preloading application
2015-07-06T06:58:52.639573+00:00 app[web.1]: [2015-07-06 06:58:52] INFO WEBrick 1.3.1
2015-07-06T06:58:52.639582+00:00 app[web.1]: [2015-07-06 06:58:52] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T06:58:52.640986+00:00 app[web.1]: [2015-07-06 06:58:52] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T06:59:43.770715+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T06:59:43.770935+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T06:59:44.670643+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T06:59:44.659706+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T13:23:13.180759+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T13:23:17.913267+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T13:23:20.049616+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T13:23:20.049642+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T13:23:20.049644+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T13:23:20.049645+00:00 app[web.1]: [3] * Environment: production
2015-07-06T13:23:20.049646+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T13:23:20.049647+00:00 app[web.1]: [3] * Preloading application
2015-07-06T13:23:21.404107+00:00 app[web.1]: [2015-07-06 13:23:21] INFO WEBrick 1.3.1
2015-07-06T13:23:21.404116+00:00 app[web.1]: [2015-07-06 13:23:21] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T13:23:21.405443+00:00 app[web.1]: [2015-07-06 13:23:21] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T13:24:18.189387+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T13:24:18.189437+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T13:24:19.089242+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T13:24:19.072229+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T15:22:24.594997+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T15:22:35.297440+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T15:22:37.447910+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T15:22:37.447935+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T15:22:37.447936+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T15:22:37.447939+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T15:22:37.447938+00:00 app[web.1]: [3] * Environment: production
2015-07-06T15:22:37.447940+00:00 app[web.1]: [3] * Preloading application
2015-07-06T15:22:38.766153+00:00 app[web.1]: [2015-07-06 15:22:38] INFO WEBrick 1.3.1
2015-07-06T15:22:38.766821+00:00 app[web.1]: [2015-07-06 15:22:38] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T15:22:38.766189+00:00 app[web.1]: [2015-07-06 15:22:38] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T15:23:35.760684+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T15:23:35.760778+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T15:23:36.539883+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T15:23:36.527478+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T17:30:37.325877+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T17:30:42.021403+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T17:30:44.494517+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T17:30:44.494549+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T17:30:44.494552+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T17:30:44.494555+00:00 app[web.1]: [3] * Environment: production
2015-07-06T17:30:44.494561+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T17:30:44.494566+00:00 app[web.1]: [3] * Preloading application
2015-07-06T17:30:46.066668+00:00 app[web.1]: [2015-07-06 17:30:46] INFO WEBrick 1.3.1
2015-07-06T17:30:46.066681+00:00 app[web.1]: [2015-07-06 17:30:46] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T17:30:46.067472+00:00 app[web.1]: [2015-07-06 17:30:46] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T17:31:42.216702+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T17:31:42.216702+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T17:31:43.293523+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T17:31:43.303355+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T18:08:50.438380+00:00 heroku[api]: Deploy 4925673 by myemail@gmail.com
2015-07-06T18:08:50.438380+00:00 heroku[api]: Release v20 created by myemail@gmail.com
2015-07-06T18:08:50.484157+00:00 heroku[slug-compiler]: Slug compilation started
2015-07-06T18:08:50.484189+00:00 heroku[slug-compiler]: Slug compilation finished
2015-07-06T18:08:50.604065+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T18:08:55.633537+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T18:08:58.092779+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T18:08:58.092816+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T18:08:58.092818+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T18:08:58.092820+00:00 app[web.1]: [3] * Environment: production
2015-07-06T18:08:58.092821+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T18:08:58.092822+00:00 app[web.1]: [3] * Preloading application
2015-07-06T18:08:59.669817+00:00 app[web.1]: [2015-07-06 18:08:59] INFO WEBrick 1.3.1
2015-07-06T18:08:59.669828+00:00 app[web.1]: [2015-07-06 18:08:59] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T18:08:59.671165+00:00 app[web.1]: [2015-07-06 18:08:59] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T18:09:56.054524+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T18:09:56.054740+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T18:09:57.007247+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T18:09:57.008402+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-06T18:09:56.997273+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T18:10:04.094757+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2015-07-06T18:10:08.213157+00:00 app[web.1]: [3] Puma starting in cluster mode...
2015-07-06T18:10:08.213182+00:00 app[web.1]: [3] * Version 2.11.3 (ruby 2.2.2-p95), codename: Intrepid Squirrel
2015-07-06T18:10:08.213184+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2015-07-06T18:10:08.213186+00:00 app[web.1]: [3] * Environment: production
2015-07-06T18:10:08.213187+00:00 app[web.1]: [3] * Process workers: 2
2015-07-06T18:10:08.213188+00:00 app[web.1]: [3] * Preloading application
2015-07-06T18:10:09.863174+00:00 app[web.1]: [2015-07-06 18:10:09] INFO WEBrick 1.3.1
2015-07-06T18:10:09.863277+00:00 app[web.1]: [2015-07-06 18:10:09] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
2015-07-06T18:10:09.864197+00:00 app[web.1]: [2015-07-06 18:10:09] INFO WEBrick::HTTPServer#start: pid=3 port=2010
2015-07-06T18:10:30.791209+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=serene-temple-3871.herokuapp.com request_id=27f05fb1-5011-46d0-bdbd-68afe5d4103c fwd="71.198.39.241" dyno= connect= service= status=503 bytes=
2015-07-06T18:11:04.587671+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-07-06T18:11:04.587671+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-07-06T18:11:06.054299+00:00 heroku[web.1]: Process exited with status 137
2015-07-06T18:11:06.070843+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-06T18:11:07.079354+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-temple-3871.herokuapp.com request_id=bb9ba93e-5892-40c1-bf69-fe4cbaba929b fwd="71.198.39.241" dyno= connect= service= status=503 bytes=
【问题讨论】:
-
你能把你
Procfile的内容贴出来吗?从错误日志的第一眼看,您似乎正在对侦听端口进行硬编码(不要)。 -
我从 heroku 的文档中得到了正确的放置内容。网络:捆绑执行 puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
标签: ruby-on-rails ruby-on-rails-4 heroku