【问题标题】:Trouble with Rails Unicorn Web Server starting on Heroku从 Heroku 开始的 Rails Unicorn Web 服务器出现问题
【发布时间】:2015-03-13 21:05:12
【问题描述】:

我一直在对 Heroku 上崩溃的应用程序进行故障排除,但没有成功。我正在使用:

  • Ruby 2.1.0
  • Rails 4.1.6
  • 独角兽网络服务器

我在访问我的网址时遇到应用程序错误。

这是heroku logs的最后几行

2015-03-13T20:44:36.095469+00:00 app[web.1]:    from config.ru:1:in      `new'
2015-03-13T20:44:36.095481+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `load'
2015-03-13T20:44:36.095477+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-    4.8.3/lib/unicorn/http_server.rb:764:in `build_app!'
2015-03-13T20:44:36.095483+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `<main>'
2015-03-13T20:44:36.095470+00:00 app[web.1]:    from config.ru:1:in `<main>'
2015-03-13T20:44:36.095471+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `eval'
2015-03-13T20:44:36.095467+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2015-03-13T20:44:36.095473+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `block in builder'
2015-03-13T20:44:36.095474+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `call'
2015-03-13T20:44:36.095479+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:137:in `start'
2015-03-13T20:44:36.095480+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
2015-03-13T20:44:36.912915+00:00 heroku[web.1]: Process exited with status 1
2015-03-13T20:44:37.040788+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-13T20:45:09.859594+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=stand-as-witnesses-staging.herokuapp.com request_id=2228b811-6b37-482e-a1ec-630699947581 fwd="71.232.132.204" dyno= connect= service= status=503 bytes=

Heroku ps 给出:

=== web (1X): `bundle exec unicorn -p $PORT -c ./config/unicorn.rb`
web.1: crashed 2015/03/13 16:44:37 (~ 19m ago)

我从 Ruby 2.0.0 升级到 2.1.0,从 Unicorn 4.6.3 升级到 4.8.3,看看是否能解决问题,但没有任何帮助。

我的 Procfile 和 app/config/unicorn.rb 文件是基于 Heroku 使用 unicorn 的说明的标准文件。

由于应用程序在本地运行良好,任何人都可以指出我为什么会崩溃吗?

谢谢!

【问题讨论】:

  • 似乎您只提供了部分回溯。您能否提供日志中的所有错误回溯?
  • 完整的heroku日志结果显示在这里:gist.github.com/lgrains/1f65ef9c3269ad470d65
  • 您的问题related toapp/admin/blocked_site.rb 中的问题。尝试调查导致此 AA 文件的原因:superclass mismatch for class BlockedSitesController (TypeError)

标签: ruby-on-rails ruby heroku unicorn


【解决方案1】:

似乎您应该在app/admin/blocked_site.rb AA 文件中指定控制器的模型类(据我所知这是BlockedSite)。这应该可以修复错误:

superclass mismatch for class BlockedSitesController (TypeError)

【讨论】:

    【解决方案2】:

    感谢您为我指明正确的方向。事实证明,问题在于我们在app/controllers/admin/blocked_sites_controller.rb 中有一个现有文件。当我删除该文件和同一位置的其他几个文件时,崩溃消失了,我能够导航到我的页面。

    【讨论】:

      猜你喜欢
      • 2013-06-19
      • 1970-01-01
      • 1970-01-01
      • 2010-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-18
      • 1970-01-01
      相关资源
      最近更新 更多