ruby-on-rails - Heroku - 错误 H10(应用程序崩溃)Ruby on Rails

标签 ruby-on-rails heroku

不知道我做错了什么。应用程序在本地运行良好,但我不断收到应用程序错误页面和 H10 error 。我将发布 Rails 控制台输出,因为我读到它比 Heroku 日志更有用,但如果需要,我可以将其放在这里。我真的希望这不会被忽视,因为我现在完全迷失了。

Rails 控制台:

Running `rails console` attached to terminal... up, run.8093
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.1/lib/active_record/dynamic_
matchers.rb:26:in `method_missing': undefined local variable or method `request'
 for Session (call 'Session.connection' to establish a connection):Class (NameEr
ror)
        from /app/app/models/session.rb:3:in `<class:Session>'
        from /app/app/models/session.rb:1:in `<top (required)>'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `require'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `block in require'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:240:in `load_dependency'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `require'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:360:in `require_or_load'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:317:in `depend_on'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:233:in `require_dependency'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:472:in `block (2 levels) in eager_load!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:471:in `each'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:471:in `block in eager_load!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:469:in `each'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:469:in `eager_load!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.
rb:346:in `eager_load!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/applica
tion/finisher.rb:56:in `each'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/applica
tion/finisher.rb:56:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initial
izable.rb:30:in `instance_exec'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initial
izable.rb:30:in `run'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initial
izable.rb:55:in `block in run_initializers'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tso
rt_each'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 lev
els) in each_strongly_connected_component'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongl
y_connected_component_from'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in eac
h_strongly_connected_component'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongl
y_connected_component'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
        from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initial
izable.rb:54:in `run_initializers'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/applica
tion.rb:352:in `initialize!'
        from /app/config/environment.rb:5:in `<top (required)>'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `require'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `block in require'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:240:in `load_dependency'
        from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_s
upport/dependencies.rb:274:in `require'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/applica
tion.rb:328:in `require_environment!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/command
s/commands_tasks.rb:142:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/command
s/commands_tasks.rb:67:in `console'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/command
s/commands_tasks.rb:39:in `run_command!'
        from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/command
s.rb:17:in `<top (required)>'
        from /app/bin/rails:4:in `require'
        from /app/bin/rails:4:in `<main>'

heroku 日志:

2015-07-05T20:21:38.932369+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_depe
ndency'
2015-07-05T20:21:38.932388+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
2015-07-05T20:21:38.932407+00:00 app[web.1]:    from /app/config.ru:3:in `block
in <main>'
2015-07-05T20:21:38.932426+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
2015-07-05T20:21:38.932465+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
2015-07-05T20:21:38.932485+00:00 app[web.1]:    from /app/config.ru:in `new'
2015-07-05T20:21:38.932542+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
2015-07-05T20:21:38.932504+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2015-07-05T20:21:38.932523+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
2015-07-05T20:21:38.932610+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'

2015-07-05T20:21:38.932579+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
2015-07-05T20:21:38.932629+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
2015-07-05T20:21:38.932648+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
2015-07-05T20:21:38.932735+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
2015-07-05T20:21:38.932675+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
2015-07-05T20:21:38.932755+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
2015-07-05T20:21:38.932839+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-07-05T20:21:38.932774+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in serv
er'
2015-07-05T20:21:38.932859+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-07-05T20:21:38.932878+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'

2015-07-05T20:21:38.932897+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
2015-07-05T20:21:38.932931+00:00 app[web.1]:    from bin/rails:4:in `require'
2015-07-05T20:21:38.932951+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2015-07-05T20:21:39.917826+00:00 heroku[web.1]: State changed from starting to c
rashed
2015-07-05T20:21:39.919080+00:00 heroku[web.1]: State changed from crashed to st
arting
2015-07-05T20:21:39.901026+00:00 heroku[web.1]: Process exited with status 1
2015-07-05T20:21:44.803632+00:00 heroku[web.1]: Starting process with command `b
in/rails server -p 4674 -e production`
2015-07-05T20:21:50.648458+00:00 app[web.1]: => Booting WEBrick
2015-07-05T20:21:50.648478+00:00 app[web.1]: => Rails 4.2.1 application starting
 in production on http://0.0.0.0:4674
2015-07-05T20:21:50.648480+00:00 app[web.1]: => Run `rails server -h` for more s
tartup options
2015-07-05T20:21:50.648481+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-07-05T20:21:50.648482+00:00 app[web.1]: Exiting
2015-07-05T20:21:50.648756+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/
activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing':
 undefined local variable or method `request' for Session (call 'Session.connect
ion' to establish a connection):Class (NameError)
2015-07-05T20:21:50.648758+00:00 app[web.1]:    from /app/app/models/session.rb:
3:in `<class:Session>'
2015-07-05T20:21:50.648762+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
2015-07-05T20:21:50.648763+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in
require'
2015-07-05T20:21:50.648760+00:00 app[web.1]:    from /app/app/models/session.rb:
1:in `<top (required)>'
2015-07-05T20:21:50.648766+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
2015-07-05T20:21:50.648764+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_depe
ndency'
2015-07-05T20:21:50.648771+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:472:in `block (2 levels) in eager_loa
d!'
2015-07-05T20:21:50.648767+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in `require_o
r_load'
2015-07-05T20:21:50.648768+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:317:in `depend_on
'
2015-07-05T20:21:50.648770+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:233:in `require_d
ependency'
2015-07-05T20:21:50.648773+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:471:in `each'
2015-07-05T20:21:50.648775+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:471:in `block in eager_load!'
2015-07-05T20:21:50.648776+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:469:in `each'
2015-07-05T20:21:50.648779+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:346:in `eager_load!'
2015-07-05T20:21:50.648782+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:56:in `block in <module
:Finisher>'
2015-07-05T20:21:50.648778+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/engine.rb:469:in `eager_load!'
2015-07-05T20:21:50.648784+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
2015-07-05T20:21:50.648781+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:56:in `each'
2015-07-05T20:21:50.648783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
2015-07-05T20:21:50.648788+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_componen
t'
2015-07-05T20:21:50.648786+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initialize
rs'
2015-07-05T20:21:50.648787+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
2015-07-05T20:21:50.648789+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
2015-07-05T20:21:50.648793+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:345:in `call'
2015-07-05T20:21:50.648799+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
2015-07-05T20:21:50.648790+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
2015-07-05T20:21:50.648795+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
2015-07-05T20:21:50.648792+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:345:in `each'
2015-07-05T20:21:50.648796+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:224:in `tsort_each'
2015-07-05T20:21:50.648798+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/
ruby/2.1.0/tsort.rb:205:in `tsort_each'
2015-07-05T20:21:50.648803+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
2015-07-05T20:21:50.648805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_depe
ndency'
2015-07-05T20:21:50.648804+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in
require'
2015-07-05T20:21:50.648806+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
2015-07-05T20:21:50.648815+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
2015-07-05T20:21:50.648800+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
2015-07-05T20:21:50.648813+00:00 app[web.1]:    from /app/config.ru:3:in `block
in <main>'
2015-07-05T20:21:50.648801+00:00 app[web.1]:    from /app/config/environment.rb:
5:in `<top (required)>'
2015-07-05T20:21:50.648817+00:00 app[web.1]:    from /app/config.ru:in `new'
2015-07-05T20:21:50.648820+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
2015-07-05T20:21:50.648825+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
2015-07-05T20:21:50.648821+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
2015-07-05T20:21:50.648826+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
2015-07-05T20:21:50.648829+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
2015-07-05T20:21:50.648832+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-07-05T20:21:50.648816+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
2015-07-05T20:21:50.648839+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2015-07-05T20:21:50.648819+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2015-07-05T20:21:50.648823+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
2015-07-05T20:21:50.648824+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'

2015-07-05T20:21:50.648828+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
2015-07-05T20:21:50.648830+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
2015-07-05T20:21:50.648835+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'

2015-07-05T20:21:50.648831+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in serv
er'
2015-07-05T20:21:50.648838+00:00 app[web.1]:    from bin/rails:4:in `require'
2015-07-05T20:21:50.648834+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-07-05T20:21:50.648837+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1
.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
2015-07-05T20:21:51.832370+00:00 heroku[web.1]: Process exited with status 1
2015-07-05T20:21:51.845270+00:00 heroku[web.1]: State changed from starting to c
rashed
2015-07-05T20:23:44.683352+00:00 heroku[api]: Starting process with command `bun
dle exec rake db:migrate` by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7511031c11444c4c41351218141c195b161a18" rel="noreferrer noopener nofollow">[email protected]</a>
2015-07-05T20:23:49.876519+00:00 heroku[run.7443]: Awaiting client
2015-07-05T20:23:49.931116+00:00 heroku[run.7443]: Starting process with command
 `bundle exec rake db:migrate`
2015-07-05T20:23:55.352150+00:00 heroku[run.7443]: Process exited with status 0
2015-07-05T20:23:55.365935+00:00 heroku[run.7443]: State changed from up to comp
lete
2015-07-05T20:23:50.311272+00:00 heroku[run.7443]: State changed from starting t
o up
2015-07-05T20:25:16.824478+00:00 heroku[api]: Scale to web=1 by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f99d8f909dc8c0c0cdb99e94989095d79a" rel="noreferrer noopener nofollow">[email protected]</a>
om
2015-07-05T20:27:09.578310+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=glacial-falls-7476.herokuapp.com request_id=6a99e
c01-98d6-45cf-bc2c-8ec05a0f7ab9 fwd="50.163.200.7" dyno= connect= service= statu
s=503 bytes=
2015-07-05T22:28:51.659970+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=glacial-falls-7476.herokuapp.com request_id=13681
1f6-73cf-4708-96a9-d48e26d61dd1 fwd="50.163.200.7" dyno= connect= service= statu
s=503 bytes=

生产 rake :

I, [2015-07-05T16:16:54.146798 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/tapedek3-4343c22664d06b029040ca2311b3fc956f7fb61b1dc8aa0beb8b1e
bbe23c9e31.png
I, [2015-07-05T16:16:59.754119 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/application-ddbb9538bbe5eff3b50ef226fc0aa9af7da7fa937082f4ef22b
7e8c339a0bcde.js
I, [2015-07-05T16:17:07.206545 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/application-f0703cab74ba3b243988bfab9161553021c1568ea0daae042a2
b215f37284023.css
I, [2015-07-05T16:17:07.219546 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108
ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot
I, [2015-07-05T16:17:07.232546 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa4
2abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg
I, [2015-07-05T16:17:07.240547 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb1389
57d06a1ea9361bdcf0b442d06a18a8051af57456.ttf
I, [2015-07-05T16:17:07.245547 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/bootstrap/glyphicons-halflings-regular-a26394f7ede100ca118eff2e
da08596275a9839b959c226e15439557a5a80742.woff
I, [2015-07-05T16:17:07.250547 #21460]  INFO -- : Writing C:/row/dev/project/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb78
3312a0cda5a44c4039214094e7957b4c040ef11c.woff2

最佳答案

Rails Assets 管道

这可能需要几次迭代才能完成。 Heroku 标记的第一个错误是/favicon.ico 上的 GET 失败

2015-07-05T17:56:19.804219+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=glacial-falls-7476.herokuapp.com reque
st_id=091b3b97-bbab-4d13-b6a1-da24aa2b018b fwd="50.163.200.7" dyno= connect= ser
vice= status=503 bytes=

这告诉我们存在 Assets 管道问题,因为应用程序应该查找类似下面的文件名的内容,而不是原始文件名:

href="/assets/favicon-17897c732521afcc30d49410042fc687.ico"

favicon 文件名应该是编译后的资源名称。有许多步骤可以对此进行调试:

  1. 您在部署之前是否执行了生产 rake?
$bundle exec rake assets:precompile RAILS_ENV=production
  • 非常好,下一步是将应用推送到 Heroku,以部署应用 blob,其中包含为 Rails Assets 管道正确编译的 Assets 。
  • $heroku push
    

    如果您的应用程序崩溃,请发布更新的 Heroku 日志。如果它运行了,哇哦。这是唯一的问题。

  • 所以简单的解决方案不起作用。它甚至没有编译 .ico 资源。这意味着配置中存在一些问题,因此它无法正确构建应用程序 blob。
  • 除此之外,新日志中还存在许多严重错误。

    WEBrick 不应该是在 Heroku 上运行的服务器——这是一个危险信号。您知道 WEBrick 为何推出吗?

    IP 看起来也不正确。

    Rails 4.2.1 application starting in production on http://0.0.0.0:4674
    

    这个区 block 中的所有内容都需要修复,我认为这并不容易。将一个工作应用程序从开发推到 Heroku 通常很容易,我不知道你有什么设置会导致它陷入困境。我会查看 Gemfile、生产、rb、application.rb,了解“开发”与“生产”之间的所有差异

    2015-07-05T20:21:50.648458+00:00 app[web.1]: => Booting WEBrick
    2015-07-05T20:21:50.648478+00:00 app[web.1]: => Rails 4.2.1 application starting
     in production on http://0.0.0.0:4674
    2015-07-05T20:21:50.648480+00:00 app[web.1]: => Run `rails server -h` for more s
    tartup options
    2015-07-05T20:21:50.648481+00:00 app[web.1]: => Ctrl-C to shutdown server
    2015-07-05T20:21:50.648482+00:00 app[web.1]: Exiting
    2015-07-05T20:21:50.648756+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/
    activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing':
     undefined local variable or method `request' for Session (call 'Session.connect
    ion' to establish a connection):Class (NameError)
    2015-07-05T20:21:50.648758+00:00 app[web.1]:    from /app/app/models/session.rb:
    3:in `<class:Session>'
    

    我希望我能得到一个简单的答案,但我没有。我认为有几个部署问题需要解决,一次一个。

    我的建议是缩小应用程序规模,或者从虚拟测试应用程序开始并分阶段部署。

    或者也许有人会提供完整的答案......

    关于ruby-on-rails - Heroku - 错误 H10(应用程序崩溃)Ruby on Rails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31233804/

    相关文章:

    javascript - 使用 Rspec : this code works but the spec can't find the route 测试 AJAX

    ruby-on-rails - 如何在没有 Controller 的情况下保护 rspec_api_documentation apitome 路由

    ruby-on-rails - Ruby on Rails : How can I revert a migration with rake db:migrate?

    ruby-on-rails - 如何在该应用程序中显示 Rails 应用程序的 git 分支?

    使用指向域的 TLS 重定向域

    ruby-on-rails - rake 数据库 :migrate is being aborted due to rake version difference

    ruby-on-rails - Rails 回形针和亚马逊 S3 'PermanentRedirect'

    javascript - 访问我的网站 (.herokuapp.com) 时,Multer (Nodejs) 图像未加载或图像消失

    node.js - 在 Heroku 部署中响应 axios 调用 Express API

    django - 我应该如何暂存我的 bitbucket + heroku django 应用程序以进行开发和部署?