【问题标题】:Heroku - Error H10 (App crashed)Heroku - 错误 H10(应用程序崩溃)
【发布时间】:2012-01-06 03:29:21
【问题描述】:

有人可以帮忙吗?我正在从 heroku 日志中粘贴日志

在开发中,一切正常,当我将它上传到 heroku 时,它崩溃了。我不知道为什么,尽管在网络上找到了所有解决方案,但我无法修复它。

MacBook-Pro-Maciej-Simm:SGHub maciejsimm$ heroku logs
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in 
`depend_on'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`require'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method
_missing'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec
'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_
initializers'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializ
ers'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/config.ru:4:in `require'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/config.ru:4:in `block in <main>'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:200:in `app'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:46:in `app'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:54:in `block in <top (req
uired)>'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `<top (required)>'
2012-01-06T03:20:30+00:00 app[web.1]:   from script/rails:6:in `require'
2012-01-06T03:20:30+00:00 app[web.1]:   from script/rails:6:in `<main>'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:252:in `start'
2012-01-06T03:20:30+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-01-06T03:20:31+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-06T03:20:31+00:00 heroku[web.1]: State changed from crashed to created
2012-01-06T03:20:31+00:00 heroku[web.1]: State changed from created to starting
2012-01-06T03:20:32+00:00 heroku[web.1]: Process exited
2012-01-06T03:20:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 33719`
2012-01-06T03:20:41+00:00 app[web.1]: => Booting WEBrick
2012-01-06T03:20:41+00:00 app[web.1]: => Rails 3.1.3 application starting in production on http://0.0.0.0:33719
2012-01-06T03:20:41+00:00 app[web.1]: Exiting
2012-01-06T03:20:41+00:00 app[web.1]: /app/app/helpers/sessions_helper.rb:34: invalid multibyte char (US-ASCII)
2012-01-06T03:20:41+00:00 app[web.1]: /app/app/helpers/sessions_helper.rb:34: syntax error, unexpected $end, expecting keyword_end
2012-01-06T03:20:41+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `requir
e': /app/app/helpers/sessions_helper.rb:34: invalid multibyte char (US-ASCII) (SyntaxError)
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`block in require'
2012-01-06T03:20:41+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-01-06T03:20:41+00:00 app[web.1]: ..._path, :notice => "Zaloguj się aby zobaczyć tą stronę"
2012-01-06T03:20:41+00:00 app[web.1]: ...                               ^
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in 
`load_dependency'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`require'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in 
`depend_on'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/abstract_controller/helpers.rb:135:in `bl
ock in modules_for_helpers'
2012-01-06T03:20:41+00:00 app[web.1]: => Call with -d to detach
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214:in 
`require_dependency'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/abstract_controller/helpers.rb:131:in `mo
dules_for_helpers'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/abstract_controller/helpers.rb:95:in `hel
per'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/action_controller/railties/paths.rb:17:in
 `block (2 levels) in with'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/app/controllers/application_controller.rb:1:in `<top (required)>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/action_controller/metal/helpers.rb:89:in 
`modules_for_helpers'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.3/lib/abstract_controller/helpers.rb:131:in `ma
p!'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348:in 
`require_or_load'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214:in 
`require_dependency'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348:in 
`require_or_load'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in 
`load_dependency'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`block in require'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`require'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in 
`depend_on'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in 
`require'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application/finisher.rb:51:in `block 
in <module:Finisher>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in `each'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:417:in `block (2 levels) in
 eager_load!'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in `each'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in `block in eager_load
!'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_
initializers'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec
'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method
_missing'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in `eager_load!'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/config.ru:4:in `require'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/config.ru:4:in `block in <main>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:200:in `app'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:252:in `start'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:46:in `app'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializ
ers'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:54:in `block in <top (req
uired)>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `<top (required)>'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app'
2012-01-06T03:20:41+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
2012-01-06T03:20:41+00:00 app[web.1]:   from script/rails:6:in `require'
2012-01-06T03:20:41+00:00 app[web.1]:   from script/rails:6:in `<main>'
2012-01-06T03:20:43+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-06T03:20:43+00:00 heroku[web.1]: Process exited
2012-01-06T03:20:45+00:00 heroku[router]: Error H10 (App crashed) -> GET afternoon-earth-4144.herokuapp.com/ dyno= queue= wait= service= statu
s=503 bytes=
2012-01-06T03:20:46+00:00 heroku[router]: Error H10 (App crashed) -> GET afternoon-earth-4144.herokuapp.com/favicon.ico dyno= queue= wait= ser
vice= status=503 bytes=
2012-01-06T03:20:51+00:00 heroku[router]: Error H10 (App crashed) -> GET afternoon-earth-4144.herokuapp.com/ dyno= queue= wait= service= statu
s=503 bytes=
MacBook-Pro-Maciej-Simm:SGHub maciejsimm$ 

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 encoding utf-8 heroku


    【解决方案1】:

    问题似乎就在这里:

    /app/app/helpers/sessions_helper.rb:34: invalid multibyte char (US-ASCII)
    ...
    ..._path, :notice => "Zaloguj się aby zobaczyć tą stronę"
                                      ^
    

    注意错误中的“US-ASCII”。我猜您的来源实际上是 UTF-8,所以请尝试添加此评论:

    # encoding: UTF-8
    

    在app/helpers/sessions_helper.rb 的顶部。这将告诉 Ruby 该源文件是 UTF-8。您可能在其他源文件中也需要它。

    另一种方法是将您的 language at Heroku 设置为 UTF:

    $ heroku config:add LANG=pl_PL.UTF-8
    

    我不确定 Heroku 是否会对波兰语感到满意,因此您可能需要改用 en_US.UTF-8。

    【讨论】:

    • 谢谢它!然后我在预编译资产方面遇到了一点问题,但毕竟一切正常。
    猜你喜欢
    • 2016-08-20
    • 2012-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多