gpt4 book ai didi

ruby-on-rails - Rails 应用程序在 Heroku 上崩溃,但在本地运行良好 -> "State changed from starting to crashed"

转载 作者:行者123 更新时间:2023-12-04 13:23:28 25 4
gpt4 key购买 nike

repo 地址:git@github.com:assafshomer/sample_app.git

  • 这个应用程序是我的学习应用程序,基于 Michael Hartl 的优秀 railstutorial。
  • App在开发中运行流畅,测试套件全绿
  • 部署到 Heroku 时,我立即收到以下错误:“应用程序错误。应用程序中发生错误,无法提供您的页面”
  • 升级到 Rails4 后问题开始了(但我知道问题不是 Rails4 本身,因为例如 git://github.com/railstutorial/sample_app_rails_4.git 可以很好地部署到 Heroku)
  • 我知道您会问“您是否在 Heroku 上迁移了数据库?”。我做到了。我什至在 Heroku 上运行 pg:reset 然后再次 rake 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 中,负责启动阶段的几个文件( bin/railsbin/rakebin/bundle )被新添加或从不同位置移动(例如 script/rails )。

    似乎您的应用程序中缺少它们。奇怪的是,它可以在您的本地机器上运行,但不能在 heroku 上运行 - 但我尝试并添加了它们。它似乎工作。

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

    关于ruby-on-rails - Rails 应用程序在 Heroku 上崩溃,但在本地运行良好 -> "State changed from starting to crashed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16756866/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com