Lan*_*opp 4 deployment ruby-on-rails heroku
我对整个部署工作都很陌生.在我第一次创建应用程序之前,我已经部署了一次我的应用程序,然后一切似乎都运行正常.我现在对我的应用程序进行了一些更改,我想部署它们并确保它们在生产环境中工作.我添加并提交了我的最后一项更改,并将我的更改合并到我的主分支中.然后我跑了git push heroku master.我在输出中收到以下错误:
Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
Run Code Online (Sandbox Code Playgroud)
好的,所以我需要更新我的gemfile.首先,我检查了我的.gitignore文件的内容,它们是:
.bundle
db/*.sqlite3*
log/*.log
*.log
/tmp/
doc/
*.swp
*~
.project
.DS_Store
.psd
Run Code Online (Sandbox Code Playgroud)
Gemfile.lock 好像不在那里,但我还是尝试了以下方法:
git add .
git commit -m "updated Gemfile.lock"
Run Code Online (Sandbox Code Playgroud)
然后我再次推到Heroku并得到了同样的错误.接下来,我试过:
git add Gemfile Gemfile.lock
git commit -m "updated Gemfile.lock (again)"
Run Code Online (Sandbox Code Playgroud)
推后,我得到了同样的结果.搜索了一会儿之后,我找到了这篇文章,这促使我尝试以下方法:
gem update bundler
bundle update
git add Gemfile Gemfile.lock
git commit -m "updated Gemfile.lock (again (again))"
Run Code Online (Sandbox Code Playgroud)
仍然没有运气,而且我现在几乎没有想法.我很感激任何建议.
Lan*_*opp 10
事实证明答案很简单.根据Heroku Support Guy,您不能在Gemfile中使用if语句.我的Gemfile中的违规行是:
gem 'rb-fsevent', :require => true if (RUBY_PLATFORM =~ /darwin/i)
Run Code Online (Sandbox Code Playgroud)