Rails应用程序在Heroku上崩溃但在本地运行正常 – >“状态从开始变为崩溃”

repo at:git@github.com:assafshomer / sample_app.git

  1. 这个应用程序是我的学习应用程序基于迈克尔哈特尔出色的铁路教程。
  2. 应用程序在开发中运行顺畅,测试套件全部为绿色
  3. 部署到Heroku时,我立即得到以下错误:“应用程序错误。应用程序中发生错误,无法提供您的页面”
  4. 升级到Rails4之后问题就开始了(但我知道问题不在于Rails4本身,因为例如git://github.com/railstutorial/sample_app_rails_4.git可以很好地部署到Heroku)
  5. 我知道你会问“你在Heroku上迁移了数据库吗?”。 我做到了。 我甚至运行pg:reset然后再次在Heroku上运行db:migrate以防万一。 他们似乎运行正常。

Heroku日志也不提供任何信息(至少,我认为没有任何用处)

2013-05-25T22:11:26.070468+00:00 heroku[web.1]: Process exited with status 0 2013-05-25T22:11:26.083572+00:00 heroku[web.1]: State changed from starting to crashed 2013-05-25T22:13:09.372294+00:00 heroku[run.4121]: State changed from up to complete 2013-05-25T22:13:09.357146+00:00 heroku[run.4121]: Process exited with status 1 2013-05-25T22:13:50.829887+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=devsampleapp.herokuapp.com fwd="93.172.16.63" dyno= connect= service= status=503 bytes= 

rails控制台也没出现:

 2013-05-26T06:41:34.942569+00:00 heroku[api]: Starting process with command `bin/rails console` by assafshomer@gmail.com 2013-05-26T06:41:38.312107+00:00 heroku[run.5325]: Awaiting client 2013-05-26T06:41:38.339816+00:00 heroku[run.5325]: Starting process with command `bin/rails console` 2013-05-26T06:41:39.112396+00:00 heroku[run.5325]: Client connection closed. Sending SIGHUP to all processes 2013-05-26T06:41:40.329832+00:00 heroku[run.5325]: Process exited with status 0 2013-05-26T06:41:40.357047+00:00 heroku[run.5325]: State changed from starting to complete 

我提交了一张Heroku的支持票,但这只会在最早的星期二进行,而且我很想让这个“升级到rails4”已经工作了,所以,任何帮助解决这个谜团的人都会非常感激。

很明显,重现的最好方法是克隆repo并部署到heroku 🙂

谢谢!!

Assaf Shomer(gmail的assafshomer)

在rails4中,新添加或从不同位置(例如script/rails )移动了几个负责启动阶段的文件( bin/railsbin/rakebin/bundle )。

似乎在您的应用程序中缺少它们。 奇怪的是它确实适用于你的本地机器而不是heroku – 但我尝试并添加了它们。 它似乎工作。

您只需运行rake rails:update:bin即可创建它们rake rails:update:bin