Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails heroku-错误代码H10 bash:bin/rails:没有这样的文件或目录_Ruby On Rails_Bash_Heroku_Ruby On Rails 4 - Fatal编程技术网

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

Ruby on rails rails heroku-错误代码H10 bash:bin/rails:没有这样的文件或目录,ruby-on-rails,bash,heroku,ruby-on-rails-4,Ruby On Rails,Bash,Heroku,Ruby On Rails 4,我试图学习Michael Hartl的rails教程,添加身份验证步骤7.29()。我的项目在本地工作,但当我尝试部署到heroku时,我得到“应用程序中发生错误,无法提供您的页面”。以下是我的日志错误: heroku[api]: Starting process with command `bundle exec rake db:migrate` by connorleech@gmail.com heroku[run.1285]: Awaiting client

我试图学习Michael Hartl的rails教程,添加身份验证步骤7.29()。我的项目在本地工作,但当我尝试部署到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:没有这样的文件或目录


为什么我的应用程序只能在本地工作,而不能部署到heroku?

Rails 4项目有一个
/bin
目录,这与我克隆的一些旧的Rails 3项目不同
/bin
包含3个文件,
bundle
rails
,和
rake
,但这些文件没有送到Heroku,因为我的全局
文件中有
bin

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

  • ~/.gitignore
  • 运行
    bundle安装
  • 承诺 使用
    git add.
    git commit-m“add bin back”进行更改
  • 使用git Push Heroku master将更改推送到Heroku

  • 我有一个类似的问题,出于某种原因,/bin文件夹没有复制到我的GitHub repo(检查你的?)。在尝试了许多其他的解决方案都没有成功之后,我运行了
    git add bin
    ,这样我就可以将bin文件夹推送到GitHub。我仍然不确定为什么我必须特别为bin文件夹做这个例外。在Linux上运行Ruby v2,Rails v4。

    查看此线程:您的问题实际上是重复的,因此我认为最好关闭此线程。此问题也很有用:heroku站点()提供的信息建议运行rake Rails:update:bin,但这对我仍然不起作用:(您是否尝试过
    heroku config:set PATH=bin:vendor/bundle/ruby/2.0.0/bin:/usr/local/bin:/usr/bin:/bin
    ruby/2.0.0/
    部分应根据您机器上现有的部分而有所不同。