【问题标题】:What does Heroku mean by app[web.1]?Heroku 所说的 app[web.1] 是什么意思?
【发布时间】:2012-10-08 21:35:18
【问题描述】:

app[web.1]<main>:48 中的 Heroku 是什么意思?

我的崩溃仅发生在 Heroku 而不是我的计算机上,我正在尝试确定导致崩溃的确切行。这些是日志

2012-10-08T21:31:49+00:00 app[web.1]: <main>:48:in `method_missing': wrong number of arguments (1 for 2) (ArgumentError)
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:104:in `block in initialize'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `load'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:104:in `==='
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `<main>'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:102:in `initialize'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:9:in `new'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:9:in `run'
2012-10-08T21:31:49+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:102:in `each'
2012-10-08T21:31:50+00:00 heroku[web.1]: Process exited with status 1
2012-10-08T21:31:50+00:00 heroku[web.1]: State changed from starting to crashed
2012-10-08T21:31:52+00:00 heroku[router]: Error H10 (App crashed) -> GET placeboxy.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=

崩溃是在我的代码中还是在 Web 服务器 Thin 或其他地方?

编辑我更改了 Procfile 以在 Heroku 上运行服务器独角兽,并且崩溃停止了。彪马也没有错误。有任何想法吗?瘦有错吗?

【问题讨论】:

  • 我唯一知道的是 app[web.1] 指的是您的测功机,如果您有多个测功机,那么您将看到 app[web.2] 等...例如,如果您有工人,它们将显示为 app[worker.1] 等等。

标签: ruby heroku rack thin


【解决方案1】:

app[web.1] 是 heroku 添加到您的日志中的标签,用于标记哪个进程正在发出日志,因为所有日志都收集在一个中心位置,您仍然可以过滤单个进程并解析进程日志。

&lt;main&gt;:48: 部分表示由于异常而停止执行的文件/行。在这种情况下 (&lt;main&gt;),它是正在运行的主脚本。你可能不会在那里找到你的错误。您必须在回溯中搜索失败的代码部分,寻找不是外部库或核心 ruby​​ 的东西。您显示的回溯没有帮助,通常堆栈跟踪中的错误要低得多。

【讨论】:

  • 感谢 saverio。我已经复制了整个堆栈跟踪。我尝试在 Heroku 上使用服务器 Unicorn 并且没有崩溃,所以可能是 Thin 崩溃了。
猜你喜欢
  • 2012-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-28
  • 2014-04-17
  • 1970-01-01
  • 1970-01-01
  • 2016-11-18
相关资源
最近更新 更多