简体   繁体   English

从Heroku开始的Rails Unicorn Web服务器出现问题

[英]Trouble with Rails Unicorn Web Server starting on Heroku

I've been trouble-shooting my crashed application on Heroku without success. 我一直在对Heroku上崩溃的应用程序进行故障排除,但未成功。 I'm using: 我正在使用:

  • Ruby 2.1.0 Ruby 2.1.0
  • Rails 4.1.6 Rails 4.1.6
  • Unicorn web server 独角兽Web服务器

I'm getting an Application Error when I go to my url. 当我转到我的网址时,出现应用程序错误。

These are the last few lines from heroku logs 这些是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 gives: Heroku ps提供:

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

I upgraded from Ruby 2.0.0 to 2.1.0 and from Unicorn 4.6.3 to 4.8.3 to see if that would solve the problem, but no help there. 我从Ruby 2.0.0升级到2.1.0,从Unicorn 4.6.3升级到4.8.3,看看是否可以解决问题,但是在那里没有帮助。

My Procfile and app/config/unicorn.rb files are standard based on Heroku's instructions for using unicorn. 我的Procfile和app / config / unicorn.rb文件是标准的,基于Heroku使用unicorn的说明。

Since the app runs fine locally, can anyone point out why I'm getting this crash? 由于该应用程序在本地运行良好,所以有人可以指出为什么我会崩溃吗?

Thanks! 谢谢!

Seems like you should specify model class instead (as I understand this is BlockedSite ) of controller in your app/admin/blocked_site.rb AA file. 似乎您应该在app/admin/blocked_site.rb AA文件中指定控制器的模型类(据我所知这是BlockedSite )。 This should fix error: 这应该修复错误:

superclass mismatch for class BlockedSitesController (TypeError)

Thanks for pointing me in the right direction. 感谢您指出正确的方向。 It turns out that the problem was that we had an existing file in app/controllers/admin/blocked_sites_controller.rb . 事实证明,问题在于我们在app/controllers/admin/blocked_sites_controller.rb有一个现有文件。 When I removed that file and a couple of others in that same location, the crashes went away and I was able to navigate to my pages. 当我在同一位置删除该文件和其他几个文件时,崩溃消失了,我得以导航到我的页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM