2014-05-09 27 views
0

當我將我的rails應用程序部署到Heroku時,出現臭名昭着的H10錯誤代碼。我能夠在開發和生產環境中在本地主機上運行應用程序,但在Heroku服務器上應用程序崩潰,並且對於我來說,我無法弄清楚爲什麼。任何幫助將不勝感激。這裏是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 [email protected] 
2014-05-09T17:47:27.663498+00:00 heroku[api]: Release v24 created by [email protected] 
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

這看起來像dev/prod parity的事情。

如何在本地運行代碼?你是否通過bundle exec運行它?我的懷疑是你有本地問題(也許依賴問題),你沒有看到,因爲你的本地應用程序實際上是壞的,但沒有在本地正確運行(但當然,這是我的一個猜測)。

+0

我通過捆綁在rails上的WEBrick服務器在本地運行我的應用程序。我可以在開發和生產環境中的rails服務器上運行我的應用程序(即將-e生產標誌傳遞給rails s命令)。有可能我有依賴問題;但是,在rails日誌輸出中沒有報告錯誤,所以我不知道如何去識別這樣的錯誤。你有什麼想法? –

+0

你用'bundle exec'在本地運行它嗎?或者你只是用'rails s'運行它?您應該使用'bundle exec'運行它 - 如果您有本地應該顯示依賴關係問題,那麼您應該運行它。 –

+0

我最終打開了Heroku支持團隊的門票。顯然,我有一個文件加載問題。由於Rails的延遲加載,該應用程序在本地工作。我通過刪除require語句來解決問題,現在應用程序再次在Heroku上運行。感謝您的意見。 –

相關問題