当我将rails应用程序部署到Heroku时,我收到了臭名昭着的H10错误代码。我能够在开发和生产环境中的localhost上运行应用程序,但应用程序在Heroku服务器上崩溃,而对于我的生活,我无法弄清楚原因。任何帮助将不胜感激。这是Heroku日志输出:
2014-05-09T17:41:54.182987+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
2014-05-09T17:41:54.182991+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2014-05-09T17:41:54.183000+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
2014-05-09T17:41:54.183002+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
2014-05-09T17:41:54.183037+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
2014-05-09T17:41:54.183039+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
2014-05-09T17:41:54.183044+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-05-09T17:41:54.183046+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
2014-05-09T17:41:54.183048+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
2014-05-09T17:41:54.183050+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
2014-05-09T17:41:54.183073+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
2014-05-09T17:41:54.183004+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
2014-05-09T17:41:54.183032+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
2014-05-09T17:41:54.183035+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
2014-05-09T17:41:54.183075+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2014-05-09T17:41:54.183081+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-05-09T17:41:54.183083+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-05-09T17:41:54.183085+00:00 app[web.1]: from /app/config.ru:in `new'
2014-05-09T17:41:54.183087+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-05-09T17:41:54.183089+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-05-09T17:41:54.183091+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-05-09T17:41:54.183094+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-05-09T17:41:54.183095+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-05-09T17:41:54.183098+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-05-09T17:41:54.183100+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/server.rb:50:in `app'
2014-05-09T17:41:54.183105+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-05-09T17:41:54.183107+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2014-05-09T17:41:54.183109+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/server.rb:69:in `start'
2014-05-09T17:41:54.183111+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
2014-05-09T17:41:54.183114+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
2014-05-09T17:41:54.183116+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
2014-05-09T17:41:54.183118+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
2014-05-09T17:41:54.183120+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
2014-05-09T17:41:54.183137+00:00 app[web.1]: from bin/rails:8:in `require'
2014-05-09T17:41:54.183144+00:00 app[web.1]: from bin/rails:8:in `<main>'
2014-05-09T17:41:55.497609+00:00 heroku[web.1]: State changed from starting to crashed
2014-05-09T17:41:55.477865+00:00 heroku[web.1]: Process exited with status 1
2014-05-09T17:42:20.351071+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=gym-buddy.herokuapp.com request_id=338088e2-cd48-4e03-b86d-f10affcc1fe6 fwd="50.161.122.172" dyno= connect= service= status=503 bytes=
2014-05-09T17:43:09.850563+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=gym-buddy.herokuapp.com request_id=c8aabac5-40d9-4280-ae09-f98e732d5aec fwd="50.161.122.172" dyno= connect= service= status=503 bytes=
2014-05-09T17:43:10.096915+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=gym-buddy.herokuapp.com request_id=d7f811bc-552b-468f-bad6-b64cc6c2b7d0 fwd="50.161.122.172" dyno= connect= service= status=503 bytes=
2014-05-09T17:47:17+00:00 heroku[slug-compiler]: Slug compilation started
2014-05-09T17:47:27+00:00 heroku[slug-compiler]: Slug compilation finished
2014-05-09T17:47:28.378988+00:00 heroku[web.1]: State changed from crashed to starting
2014-05-09T17:47:27.663397+00:00 heroku[api]: Deploy 3d09657 by arweiner@alumni.stanford.edu
2014-05-09T17:47:27.663498+00:00 heroku[api]: Release v24 created by arweiner@alumni.stanford.edu
2014-05-09T17:47:34.782209+00:00 app[web.1]: I, [2014-05-09T17:47:34.782056 #2] INFO -- : Refreshing Gem list
2014-05-09T17:47:32.436199+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 49930 -c ./config/unicorn.rb`
2014-05-09T17:47:38.786681+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
2014-05-09T17:47:38.786682+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
2014-05-09T17:47:38.786684+00:00 app[web.1]: from /app/app/controllers/contact_controller.rb:2:in `<class:ContactController>'
2014-05-09T17:47:38.786688+00:00 app[web.1]: from /app/app/controllers/contact_controller.rb:1:in `<top (required)>'
2014-05-09T17:47:38.786690+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
2014-05-09T17:47:38.786679+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
2014-05-09T17:47:38.786668+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require': No such file to load -- User (LoadError)
2014-05-09T17:47:38.786692+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
2014-05-09T17:47:38.786698+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:348:in `require_or_load'
2014-05-09T17:47:38.786695+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
2014-05-09T17:47:38.786701+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:307:in `depend_on'
2014-05-09T17:47:38.786706+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'
2014-05-09T17:47:38.786697+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
2014-05-09T17:47:38.786708+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:467:in `each'
2014-05-09T17:47:38.786711+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:467:in `block in eager_load!'
2014-05-09T17:47:38.786703+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:225:in `require_dependency'
2014-05-09T17:47:38.786720+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:346:in `eager_load!'
2014-05-09T17:47:38.786725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/application/finisher.rb:58:in `block in <module:Finisher>'
2014-05-09T17:47:38.786715+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:465:in `each'
2014-05-09T17:47:38.786716+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/engine.rb:465:in `eager_load!'
2014-05-09T17:47:38.786722+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/application/finisher.rb:58:in `each'
2014-05-09T17:47:38.786737+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
2014-05-09T17:47:38.786730+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
2014-05-09T17:47:38.786790+00:00 app[web.1]: from config.ru:4:in `require'
2014-05-09T17:47:38.786792+00:00 app[web.1]: from config.ru:4:in `block in <main>'
2014-05-09T17:47:38.786793+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-05-09T17:47:38.786795+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-05-09T17:47:38.786796+00:00 app[web.1]: from config.ru:1:in `new'
2014-05-09T17:47:38.786797+00:00 app[web.1]: from config.ru:1:in `<main>'
2014-05-09T17:47:38.786799+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `eval'
2014-05-09T17:47:38.786800+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `block in builder'
2014-05-09T17:47:38.786802+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `call'
2014-05-09T17:47:38.786805+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `build_app!'
2014-05-09T17:47:38.786806+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:137:in `start'
2014-05-09T17:47:38.786808+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
2014-05-09T17:47:38.786809+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `load'
2014-05-09T17:47:38.786811+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `<main>'
2014-05-09T17:47:38.786738+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2014-05-09T17:47:38.786733+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-05-09T17:47:38.786741+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
2014-05-09T17:47:38.786758+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
2014-05-09T17:47:38.786783+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
2014-05-09T17:47:38.786745+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
2014-05-09T17:47:38.786746+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
2014-05-09T17:47:38.786749+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
2014-05-09T17:47:38.786751+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
2014-05-09T17:47:38.786754+00:00 app[web.1]: from /app/vendor/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
2014-05-09T17:47:38.786789+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-05-09T17:47:38.786787+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
2014-05-09T17:47:38.786728+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
2014-05-09T17:47:40.340920+00:00 heroku[web.1]: State changed from starting to crashed
2014-05-09T17:47:41.711243+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=gym-buddy.herokuapp.com request_id=ca9aae56-ee44-4725-89d0-f4d108922e1a fwd="50.161.122.172" dyno= connect= service= status=503 bytes=
2014-05-09T17:47:41.947708+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=gym-buddy.herokuapp.com request_id=7aff3d6f-2687-4aa2-affd-590a3cea1b57 fwd="50.161.122.172" dyno= connect= service= status=503 bytes=
2014-05-09T17:47:40.329886+00:00 heroku[web.1]: Process exited with status 1
答案 0 :(得分:0)
这看起来像dev/prod parity。
如何在本地运行代码?你是通过bundle exec
运行的吗?我怀疑你是否有本地问题(可能是依赖问题),你没有看到,因为你的本地应用程序实际上已经被破坏但是没有在本地运行(当然,这是我的猜测)。