当我尝试将我的github应用程序部署到heroku时,我收到了他们的错误。关于这个错误意味着什么?当我转到myapp.herokuapp.com网址时,我收到一条默认的应用程序消息“应用程序中发生了错误,无法提供您的页面。请稍后再试。”
2015-12-12T20:09:58.118155+00:00 app[web.1]: from bin/rails:8:in `<main>'
2015-12-12T20:09:58.144431+00:00 app[web.1]: => Booting WEBrick
2015-12-12T20:09:58.144435+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-12-12T20:09:58.144434+00:00 app[web.1]: => Rails 4.2.4 application starting in production on http://0.0.0.0:56551
2015-12-12T20:09:58.144436+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-12-12T20:10:00.089633+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapp.herokuapp.com request_id=5c027f8f6-edc9-130c-80e3-e09852315e1d5 fwd="90.252.159.121" dyno= connect= service= status=503 bytes=
2015-12-12T20:09:58.118155+00:00 app[web.1]: from bin/rails:8:in `<main>'
2015-12-12T20:09:58.144436+00:00 app[web.1]: Exiting
2015-12-12T20:09:58.144431+00:00 app[web.1]: => Booting WEBrick
2015-12-12T20:09:58.118153+00:00 app[web.1]: from bin/rails:8:in `require'
2015-12-12T20:09:58.144435+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-12-12T20:09:58.144434+00:00 app[web.1]: => Rails 4.2.4 application starting in production on http://0.0.0.0:56551
2015-12-12T20:09:58.144436+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-12-12T20:09:58.907129+00:00 heroku[web.1]: Process exited with status 1
2015-12-12T20:09:58.911994+00:00 heroku[web.1]: State changed from starting to crashed
更新:
我成功运行heroku run rake db:migrate
并收到一个稍有不同的错误。
2015-12-14T14:46:11.598744+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
2015-12-14T14:46:11.598746+00:00 app[web.1]: from bin/rails:8:in `require'
2015-12-14T14:46:11.632494+00:00 app[web.1]: => Rails 4.2.4 application starting in production on http://0.0.0.0:20732
2015-12-14T14:46:12.680393+00:00 heroku[web.1]: State changed from starting to crashed
2015-12-14T18:20:23.431655+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapp.herokuapp.com request_id=2ed5f19a-bc65-40b8-ac3b-574d46c35ece fwd="177.127.367.126" dyno= connect= service= status=503 bytes=
: Not found
: Not found
: Not found
: Not found
: Not found
: Not found
: Not found
: Not found
: Not found
答案 0 :(得分:2)
无法告诉日志中的任何内容,这表明问题出在环境级别(您没有正确的ENV
var,或者更可能是您没有正确设置数据库)
根据经验,我发现Heroku工作得非常好除非您忘记迁移数据库。
-
如果错误,我会删除这个答案,但你最好解雇:
heroku run rake db:migrate
这将确保您在Heroku环境中设置数据库。是否问题是另一回事;我发现9/10次,没有db / not迁移Heroku中的数据库是应用程序崩溃的最大原因。