2016-04-27 127 views
0

我最近將我的Rails應用程序推送到Heroku,並得到一個崩潰錯誤(日誌中的錯誤H10)。我無法弄清楚什麼是錯的。我的Heroku應用程序崩潰(錯誤H10),我不知道爲什麼

我試過heroku restart,並在Heroku中刪除和重新部署我的應用程序。起初,當我將代碼推送到Heroku是因爲它找不到Procfile時,我收到警告,因此我按照Heroku的建議跟着these instructions安裝Puma。

不知道爲什麼會發生這種情況,我無法找到適用於其他線程的任何內容。有任何想法嗎?

我的日誌記錄在上下文中。提前致謝!

> Ariels-MacBook-Pro:UNTsafetyApp ArielSkyeBailey$ heroku logs 
> 2016-04-27T17:06:32.859125+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 
> `instance_exec' 2016-04-27T17:06:32.859125+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 
> `run' 2016-04-27T17:06:32.859133+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in 
> `block in run_initializers' 2016-04-27T17:06:32.859111+00:00 
> app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:346:in 
> `eager_load!' 2016-04-27T17:06:32.859134+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in 
> tsort_each' 2016-04-27T17:06:32.859136+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in 
> `each_strongly_connected_component_from' 
> 2016-04-27T17:06:32.859135+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 
> levels) in each_strongly_connected_component' 
> 2016-04-27T17:06:32.859143+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in 
> each_strongly_connected_component' 2016-04-27T17:06:32.859146+00:00 
> app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in 
> `each_strongly_connected_component' 2016-04-27T17:06:32.859144+00:00 
> app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each' 
> 2016-04-27T17:06:32.859145+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call' 
> 2016-04-27T17:06:32.859153+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each' 
> 2016-04-27T17:06:32.859156+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/application.rb:352:in 
> `initialize!' 2016-04-27T17:06:32.859164+00:00 app[web.1]: from 
> /app/config/environment.rb:5:in `<top (required)>' 
> 2016-04-27T17:06:32.859154+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each' 
> 2016-04-27T17:06:32.859155+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in 
> `run_initializers' 2016-04-27T17:06:32.859165+00:00 app[web.1]: from 
> config.ru:3:in `require' 2016-04-27T17:06:32.859174+00:00 app[web.1]: 
> from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 
> `initialize' 2016-04-27T17:06:32.859175+00:00 app[web.1]:  from 
> config.ru:in `new' 2016-04-27T17:06:32.859166+00:00 app[web.1]: from 
> config.ru:3:in `block in <main>' 2016-04-27T17:06:32.859182+00:00 
> app[web.1]: from config.ru:in `<main>' 
> 2016-04-27T17:06:32.859173+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 
> `instance_eval' 2016-04-27T17:06:32.859183+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 
> `eval' 2016-04-27T17:06:32.859193+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:242:in 
> `app' 2016-04-27T17:06:32.859185+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in 
> `parse_file' 2016-04-27T17:06:32.859196+00:00 app[web.1]:  from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cluster.rb:370:in 
> `run' 2016-04-27T17:06:32.859193+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:313:in 
> `load_rackup' 2016-04-27T17:06:32.859184+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 
> `new_from_string' 2016-04-27T17:06:32.859204+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:74:in 
> `run' 2016-04-27T17:06:32.859205+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:10:in `<top 
> (required)>' 2016-04-27T17:06:32.859207+00:00 app[web.1]:  from 
> /app/vendor/bundle/ruby/2.2.0/bin/puma:23:in `load' 
> 2016-04-27T17:06:32.859203+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/launcher.rb:172:in 
> `run' 2016-04-27T17:06:32.859214+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/bin/puma:23:in `<main>' 
> 2016-04-27T17:06:32.859195+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/runner.rb:123:in 
> `load_and_bind' 2016-04-27T17:06:33.592393+00:00 heroku[web.1]: State 
> changed from starting to crashed 2016-04-27T17:06:33.546195+00:00 
> heroku[web.1]: Process exited with status 1 
> 2016-04-27T17:06:39.872306+00:00 heroku[web.1]: State changed from 
> crashed to starting 2016-04-27T17:06:42.795985+00:00 heroku[web.1]: 
> Starting process with command `bundle exec puma -C config/puma.rb` 
> 2016-04-27T17:06:45.908101+00:00 app[web.1]: [3] * Min threads: 1, max 
> threads: 1 2016-04-27T17:06:45.908096+00:00 app[web.1]: [3] * Version 
> 3.4.0 (ruby 2.2.1-p85), codename: Owl Bowl Brawl 2016-04-27T17:06:45.908102+00:00 app[web.1]: [3] * Environment: 
> production 2016-04-27T17:06:45.908082+00:00 app[web.1]: [3] Puma 
> starting in cluster mode... 2016-04-27T17:06:45.908103+00:00 
> app[web.1]: [3] * Process workers: 2 2016-04-27T17:06:45.908105+00:00 
> app[web.1]: [3] * Preloading application 
> 2016-04-27T17:06:49.148825+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require' 2016-04-27T17:06:49.148442+00:00 app[web.1]: class 
> registrations::sessionsController < Devise::sessionsController 
> 2016-04-27T17:06:49.148841+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 2016-04-27T17:06:49.148777+00:00 app[web.1]:   
>^2016-04-27T17:06:49.148742+00:00 app[web.1]: 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': 
> /app/app/controllers/registrations/sessions_controller.rb:1: 
> class/module name must be CONSTANT (SyntaxError) 
> 2016-04-27T17:06:49.148766+00:00 app[web.1]: class 
> registrations::sessionsController < Devise::sessionsController 
> 2016-04-27T17:06:49.148432+00:00 app[web.1]: [3] ! Unable to load 
> application: SyntaxError: 
> /app/app/controllers/registrations/sessions_controller.rb:1: 
> class/module name must be CONSTANT 2016-04-27T17:06:49.148492+00:00 
> app[web.1]:          ^
> 2016-04-27T17:06:49.149263+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in 
> `block in run_initializers' 2016-04-27T17:06:49.149220+00:00 
> app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 
> `instance_exec' 2016-04-27T17:06:49.149248+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 
> `run' 2016-04-27T17:06:49.148858+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 2016-04-27T17:06:49.148873+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:360:in `require_or_load' 2016-04-27T17:06:49.148888+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:317:in `depend_on' 2016-04-27T17:06:49.148908+00:00 app[web.1]:  from 
> /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:233:in `require_dependency' 2016-04-27T17:06:49.148924+00:00 app[web.1]: 
> from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:472:in 
> `block (2 levels) in eager_load!' 2016-04-27T17:06:49.148941+00:00 
> app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 
> `each' 2016-04-27T17:06:49.149014+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 
> `block in eager_load!' 2016-04-27T17:06:49.149042+00:00 app[web.1]: 
> from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 
> `each' 2016-04-27T17:06:49.149057+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 
> `eager_load!' 2016-04-27T17:06:49.149114+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:346:in 
> `eager_load!' 2016-04-27T17:06:49.149128+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 
> `each' 2016-04-27T17:06:49.149162+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 
> `block in <module:Finisher>' 2016-04-27T17:06:49.149378+00:00 
> app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call' 
> 2016-04-27T17:06:49.149279+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in 
> tsort_each' 2016-04-27T17:06:49.149294+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 
> levels) in each_strongly_connected_component' 
> 2016-04-27T17:06:49.149391+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in 
> `each_strongly_connected_component' 2016-04-27T17:06:49.149309+00:00 
> app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in 
> `each_strongly_connected_component_from' 
> 2016-04-27T17:06:49.149340+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in 
> each_strongly_connected_component' 2016-04-27T17:06:49.149365+00:00 
> app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each' 
> 2016-04-27T17:06:49.149472+00:00 app[web.1]: from config.ru:3:in 
> `require' 2016-04-27T17:06:49.149564+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 
> `instance_eval' 2016-04-27T17:06:49.149576+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 
> `initialize' 2016-04-27T17:06:49.149591+00:00 app[web.1]:  from 
> config.ru:in `new' 2016-04-27T17:06:49.149405+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each' 
> 2016-04-27T17:06:49.149417+00:00 app[web.1]: from 
> /app/vendor/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each' 
> 2016-04-27T17:06:49.149430+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in 
> `run_initializers' 2016-04-27T17:06:49.149603+00:00 app[web.1]: from 
> config.ru:in `<main>' 2016-04-27T17:06:49.149615+00:00 app[web.1]: 
> from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 
> `eval' 2016-04-27T17:06:49.149628+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 
> `new_from_string' 2016-04-27T17:06:49.149642+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in 
> `parse_file' 2016-04-27T17:06:49.149704+00:00 app[web.1]:  from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:313:in 
> `load_rackup' 2016-04-27T17:06:49.149726+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:242:in 
> `app' 2016-04-27T17:06:49.149738+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/runner.rb:123:in 
> `load_and_bind' 2016-04-27T17:06:49.149750+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cluster.rb:370:in 
> `run' 2016-04-27T17:06:49.149776+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:74:in 
> `run' 2016-04-27T17:06:49.149457+00:00 app[web.1]: from 
> /app/config/environment.rb:5:in `<top (required)>' 
> 2016-04-27T17:06:49.149444+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/application.rb:352:in 
> `initialize!' 2016-04-27T17:06:49.149791+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:10:in `<top 
> (required)>' 2016-04-27T17:06:49.149762+00:00 app[web.1]:  from 
> /app/vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/launcher.rb:172:in 
> `run' 2016-04-27T17:06:49.149806+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/bin/puma:23:in `load' 
> 2016-04-27T17:06:49.149540+00:00 app[web.1]: from config.ru:3:in 
> `block in <main>' 2016-04-27T17:06:49.149882+00:00 app[web.1]: from 
> /app/vendor/bundle/ruby/2.2.0/bin/puma:23:in `<main>' 
> 2016-04-27T17:06:50.226685+00:00 heroku[web.1]: Process exited with 
> status 1 2016-04-27T17:06:50.246790+00:00 heroku[web.1]: State changed 
> from starting to crashed 2016-04-27T17:06:51.370866+00:00 
> heroku[router]: at=error code=H10 desc="App crashed" method=GET 
> path="/" host=unt-safe.herokuapp.com 
> request_id=28d89480-8c81-4100-aef1-4cddff501714 fwd="97.94.197.248" 
> dyno= connect= service= status=503 bytes= 
> 2016-04-27T17:06:51.875582+00:00 heroku[router]: at=error code=H10 
> desc="App crashed" method=GET path="/favicon.ico" 
> host=unt-safe.herokuapp.com 
> request_id=67090db5-b562-4ea4-92e6-22a7ba17df81 fwd="97.94.197.248" 
> dyno= connect= service= status=503 bytes= 

sessions_controller.rb:

> class registrations::sessionsController < Devise::sessionsController 
> 
> @users = User.all @hash = Gmaps4rails.build_markers(@users) do |user, 
> marker| marker.lat user.latitude marker.lng user.longitude end 
> end 
+0

日誌文件非常難以掃描和讀取。你能否複製並粘貼一遍,但原始的換行符是否到位? – spickermann

+0

發佈您的sessions_controller請 –

回答

0

這就是問題所在:

! Unable to load application: 
SyntaxError: /app/app/controllers/registrations/sessions_controller.rb:1: 
class/module name must be CONSTANT 

在Ruby中,常量開始用大寫字母,但你在定義你的控制器小寫:

registrations::sessionsController < Devise::sessionsController 

,使其正常資本化:當您運行rails s

Registrations::SessionsController < Devise::SessionsController 

同樣的崩潰應該在本地發生。在再次部署之前,保持迭代的速度會更快。

+0

感謝您的信息。實際上,我的應用在本地工作正常,所以這很奇怪。我會嘗試這個雖然! – ArielSkye

+0

本地(在開發模式下)Rails可能不會加載會話控制器,直到需要爲止,但是在生產中,所有內容都在啓動時加載。嘗試點擊會話端點,您應該能夠觸發問題。 –

相關問題