【问题标题】:Heroku: App CrashHeroku:应用程序崩溃
【发布时间】:2011-10-03 15:47:31
【问题描述】:

我正在尝试调试我的 heroku 应用程序,我需要一些指导。一切都适用于我的开发环境。

起初我认为这是一个 db 问题,所以我用 taps gem 运行了heroku db:push。这是我第一次使用 heroku 进行部署,也是我第一次使用 rails,所以我有点迷路了。 :/

我的heroku logs

2011-07-12T13:31:56+00:00 heroku[web.1]: Starting process with command: `thin -p 17708 -e production -R /home/heroku_rack/heroku.ru start`
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:300:in `depend_on'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `instance_exec'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `block in run_initializers'
2011-07-12T13:31:56+00:00 app[web.1]:   from <internal:lib/rubygems/custom_requir

2011-07-12T13:31:56+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `eval'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-07-12T13:31:56+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `block in <main>'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.11/lib/rack/adapter/loader.rb:36:in `load'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
2011-07-12T13:31:56+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.11/bin/thin:6:in `<top (required)>'
2011-07-12T13:41:36+00:00 heroku[web.1]: State changed from crashed to created
2011-07-12T13:41:36+00:00 heroku[web.1]: State changed from created to starting
2011-07-12T13:41:48+00:00 heroku[web.1]: Starting process with command: `thin -p 6465 -e production -R /home/heroku_rack/heroku.ru start`
2011-07-12T13:41:55+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require': /app/app/models/settings.rb:2: syntax error, unexpected ':', expecting keyword_end (SyntaxError)
2011-07-12T13:41:55+00:00 app[web.1]:   attr_accessible :var :value
2011-07-12T13:41:55+00:00 app[web.1]:                         ^
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:300:in `depend_on'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/engine.rb:137:in `each'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/engine.rb:137:in `block in eager_load!'


2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/engine.rb:135:in `eager_load!'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:108:in `eager_load!'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `instance_exec'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `block in run_initializers'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `each'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2011-07-12T13:41:55+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-07-12T13:41:55+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-07-12T13:41:55+00:00 app[web.1]:   from config.ru:3:in `block (3 levels) in <main>'
2011-07-12T13:41:55+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>'
2011-07-12T13:41:55+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `eval'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `new'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `map'
2011-07-12T13:41:55+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in <main>'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-07-12T13:41:55+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-07-12T13:41:55+00:00 heroku[web.1]: Process exited
2011-07-12T13:41:56+00:00 heroku[web.1]: State changed from starting to crashed
2011-07-12T13:41:57+00:00 heroku[router]: Error H10 (App crashed) -> GET young-window-197.heroku.com/countdown dyno= queue= wait= service= status=503 bytes=
2011-07-12T13:41:57+00:00 heroku[router]: Error H10 (App crashed) -> GET young-window-197.heroku.com/favicon.ico dyno= queue= wait= service= status=503 bytes=

【问题讨论】:

  • 为什么投反对票?这可能是一个无知的问题,但它仍然与 SO 相关,并且答案对新手很有用。

标签: ruby-on-rails deployment migration production


【解决方案1】:

这是你的错误:

/app/app/models/settings.rb:2: syntax error, unexpected ':', expecting keyword_end (SyntaxError)

在您的设置模型中,您需要在虚拟属性之间放置一个逗号:

attr_accessible :var :value

应该是:

attr_accessible :var, :value

【讨论】:

  • 但是奇怪的是本地运行,可能是开发配置有问题?
  • 开发出于某种原因不会抱怨太多错误。 WTF 我知道,但事情就是这样。
  • 谢谢!我应该抓住它。 :/ 是的,奇怪的是它在开发中没有成为问题。
猜你喜欢
  • 2019-02-06
  • 2015-04-22
  • 2016-11-20
  • 2016-08-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多