简体   繁体   中英

Trouble with Rails Unicorn Web Server starting on Heroku

I've been trouble-shooting my crashed application on Heroku without success. I'm using:

  • Ruby 2.1.0
  • Rails 4.1.6
  • Unicorn web server

I'm getting an Application Error when I go to my url.

These are the last few lines from 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:

=== 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.

My Procfile and app/config/unicorn.rb files are standard based on Heroku's instructions for using 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. 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 . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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