我的Heroku应用程序崩溃(错误H10),我不知道为什么

时间:2016-04-27 17:25:16

标签: ruby-on-rails ruby heroku

我最近将我的Rails应用程序推送到Heroku并出现崩溃错误(日志中的错误H10)。我无法弄清楚出了什么问题。

我已尝试heroku restart并在Heroku中删除并重新部署我的应用。起初,当我将代码推送到Heroku时,我得到了一个警告,因为它找不到Procfile,所以我按照these instructions安装了Puma,正如Heroku建议的那样。

不确定为什么会发生这种情况,我找不到任何适用于其他线程的内容。有什么想法吗?

我的日志如下所示。提前谢谢!

> 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

1 个答案:

答案 0 :(得分: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

使其适当大写:

Registrations::SessionsController < Devise::SessionsController

当您运行rails s时,应该在本地发生同样的崩溃。在再次部署之前,继续进行迭代会更快。