Heroku部署Gemfile.lock问题 [英] Heroku Deployment Gemfile.lock Problem
问题描述
git push heroku master
。我在输出中收到以下错误: 检测到Gemfile,运行Bundler版本1.0.7
检测到未解决的依赖项;安装...
使用 - 没有开发:test
您已经在开发中修改了Gemfile,但没有将生成的快照(Gemfile.lock)
检入版本控制
好的,所以我需要更新我的gemfile。首先,我检查了我的 .gitignore
文件的内容,它们是:
.bundle
db / *。sqlite3 *
log / *。log
* .log
/ tmp /
doc /
* .swp
*〜
.project
.DS_Store
.psd
Gemfile.lock
似乎没有在那里,但是我尝试了以下内容:
git add。
git commit -m更新Gemfile.lock
然后再次推送到Heroku得到相同的错误。接下来,我试过:
git add Gemfile Gemfile.lock
git commit -m更新Gemfile.lock )
推后,我得到了相同的结果。搜索了一段时间后,我发现这个的帖子,这促使我尝试以下:
gem update bundler
bundle update
git add Gemfile Gemfile.lock
git commit -m更新Gemfile.lock(再次(再次))
仍然没有运气,在这一点上我几乎没有想法。我会感谢任何建议。
事实证明答案很简单。根据Heroku Support Guy,您不能在Gemfile中使用if语句。我的Gemfile的违规行是:
gem'rb-fsevent',:require => true if(RUBY_PLATFORM =〜/ darwin / i)
I'm pretty new to this whole deployment thing. I've deployed my app once before when I first created it, and everything seemed to work okay then. I've now made some changes to my app and I'd like to deploy them and make sure they work in a production environment. I added and committed the last of my changes and merged my changed into my master branch. Then I ran git push heroku master
. I received the following error in the output:
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
Okay, so I need to update my gemfile. First, I checked the contents of my .gitignore
file, which are:
.bundle
db/*.sqlite3*
log/*.log
*.log
/tmp/
doc/
*.swp
*~
.project
.DS_Store
.psd
Gemfile.lock
doesn't seem to be in there, but I tried the following anyway:
git add .
git commit -m "updated Gemfile.lock"
I then pushed to Heroku again and got the same error. Next, I tried:
git add Gemfile Gemfile.lock
git commit -m "updated Gemfile.lock (again)"
After pushing, I got the same result. After searching around for a while, I found this post, which prompted me to try the following:
gem update bundler
bundle update
git add Gemfile Gemfile.lock
git commit -m "updated Gemfile.lock (again (again))"
Still no luck, and I'm pretty much out of ideas at this point. I'd appreciate any suggestions.
Well it turns out the answer was pretty simple. According to the Heroku Support Guy, you can't use if statements in your Gemfile. The offending line from my Gemfile was:
gem 'rb-fsevent', :require => true if (RUBY_PLATFORM =~ /darwin/i)
这篇关于Heroku部署Gemfile.lock问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!