我正在尝试按照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?
答案 0 :(得分:5)
Rails 4项目有一个/bin
目录,不像我克隆的一些旧的Rails 3项目。 /bin
包含3个文件,bundle
,rails
和rake
,但这些文件没有传到Heroku,因为我的全局bin
.gitignore
1}}文件。
如果您使用Git和其他语言(Java等),这是一个非常常见的忽略规则,所以要解决这个问题:
bin
~/.gitignore
bundle install
git add .
和git commit -m "Add bin back"
git push heroku master
答案 1 :(得分:0)
我有类似的问题,由于某种原因,/ bin文件夹没有复制到我的GitHub仓库(检查你的?)。在尝试了许多其他解决方案失败后,我运行了git add bin
并让我将bin文件夹推送到GitHub。我仍然不确定为什么我必须特别为bin文件夹做这个例外。在Linux上运行Ruby v2,Rails v4。
答案 2 :(得分:0)