繁体   English   中英

rails heroku-错误代码H10 bash:bin / rails:没有这样的文件或目录

[英]rails heroku - error code H10 bash: bin/rails: No such file or directory

我正在尝试遵循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?

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

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

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

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

耙Rails:update:bin

从这篇文章

https://devcenter.heroku.com/articles/rails4

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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