【问题标题】:rails heroku - error code H10 bash: bin/rails: No such file or directoryrails heroku - 错误代码 H10 bash: bin/rails: 没有这样的文件或目录
【发布时间】:2013-09-04 16:43:33
【问题描述】:

我正在尝试按照 Michael Hartl 的 rails 教程添加身份验证步骤 7.29 (http://ruby.railstutorial.org/chapters/sign-up#top)。我的项目在本地工作,但是当我尝试部署到 heroku 时,我得到“应用程序中发生错误,无法提供您的页面”。这些是我的日志错误:

     heroku[api]: Starting process with command `bundle exec rake db:migrate` by connorleech@gmail.com
     heroku[run.1285]: Awaiting client
     heroku[run.1285]: Starting process with command `bundle exec rake db:migrate`
     heroku[run.1285]: State changed from starting to up
     heroku[run.1285]: Process exited with status 0
     heroku[run.1285]: State changed from up to complete
     heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=jason-shark-rails-project.herokuapp.com fwd="41.74.174.50" dyno= connect= service= status=503 bytes=
     heroku[web.1]: State changed from crashed to starting
     heroku[web.1]: Starting process with command `bin/rails server -p 10431 -e $RAILS_ENV`
     app[web.1]: bash: bin/rails: No such file or directory
     heroku[web.1]: Process exited with status 127
     heroku[web.1]: State changed from starting to crashed
     heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
     heroku[web.1]: Stopping process with SIGKILL

为了部署它,我似乎在我的项目中遗漏了一些东西。bash: bin/rails: No such file or directory

为什么我的应用可以在本地运行,但不能部署到 heroku?

【问题讨论】:

标签: ruby-on-rails bash heroku ruby-on-rails-4


【解决方案1】:

Rails 4 项目有一个/bin 目录,这与我克隆的一些旧 Rails 3 项目不同。 /bin 包含 3 个文件,bundlerailsrake,但这些文件没有进入 Heroku,因为我的全局 bin 文件中有 bin

如果您使用 Git 和其他语言(Java 等),这是一个非常常见的忽略规则,因此要解决此问题:

  1. ~/.gitignore 中删除bin
  2. 运行bundle install
  3. 提交您的 随着 git add .git commit -m "Add bin back" 的变化
  4. 使用git push heroku master 将您的更改推送到 Heroku

【讨论】:

    【解决方案2】:

    我遇到了类似的问题,由于某种原因 /bin 文件夹没有复制到我的 GitHub 存储库(检查你的?)。在尝试了许多其他解决方案均未成功后,我运行了git add bin,这让我可以将 bin 文件夹推送到 GitHub。我仍然不确定为什么我必须专门为 bin 文件夹设置此例外。在 Linux 上运行 Ruby v2、Rails v4。

    【讨论】:

      猜你喜欢
      • 2013-07-16
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      • 1970-01-01
      • 1970-01-01
      • 2015-08-16
      • 2021-10-24
      • 2016-04-18
      相关资源
      最近更新 更多