How to re-sync Gemfile.lock on changes to Gemfile

我们两清 提交于 2019-12-20 17:19:08

问题


How to re-sync Gemfile.lock on changes to Gemfile.

Assuming I have 3 gems (gem1, gem2, gem3) in the Gemfile.

bundle install creates a Gemfile.lock file.

If I remove gem3 and run bundle install, I would like Gemfile.lock to be re-generated and gem3 removed from the rvm gemset. But it doesn't, how should I re-sync without dropping the gemset.


回答1:


To bring the Gemfile.lock in line with Gemfile edits, run bundle check.

To bring the Gemfile.lock in line with both the Gemfile edits AND the latest compatible gems, run bundle update.


Related: This blogpost by viget has some good advice on Bundler Best Practices



来源:https://stackoverflow.com/questions/13101945/how-to-re-sync-gemfile-lock-on-changes-to-gemfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!