2013-09-01 56 views
2

我正在尝试迈克尔哈特尔的rails教程添加验证步骤7.29(http://ruby.railstutorial.org/chapters/sign-up#top)。我的项目在本地工作,但当我尝试部署到heroku时,出现“应用程序发生错误,无法为您的页面提供服务”。这是我的错误日志:rails heroku - 错误代码H10 bash:bin/rails:没有这样的文件或目录

 heroku[api]: Starting process with command `bundle exec rake db:migrate` by [email protected] 
    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的?

+0

看到这个线程:http://stackoverflow.com/questions/17704754/heroku-app-crash-h10-bash -bin-rails-no-such-file-or-directory – konsolebox

+0

你的问题实际上是它的重复,所以我认为最好关闭它。 – konsolebox

+0

这一个也是有帮助的:http://stackoverflow.com/questions/17583439/bin-rails-no-such-file-or-directory-w-ruby-2-rails-4-on-heroku和从heroku站点(https://devcenter.heroku.com/articles/rails4)建议运行rake rails:update:bin但是这仍然不适用于我:( –

回答

5

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

这是一个很常见的忽略,如果你使用Git和其他语言(Java等)的操作规则,所以要解决这个问题:

  1. ~/.gitignore
  2. 运行删除binbundle install
  3. 提交您 变化与git add .git commit -m "Add bin back"
  4. 把你的改变的Heroku与git push heroku master
0

我有一个类似的问题,出于某种原因/ bin文件夹没有复制到我的GitHub回购(检查你的?)。在尝试了许多其他解决方案失败后,我运行git add bin,并让我将bin文件夹推送到GitHub。我仍然不确定为什么我必须特别为bin文件夹设置此例外。在Linux上运行Ruby v2,Rails v4。

相关问题