如何re-sync Gemfile。锁定对Gemfile的更改

时间:2021-08-27 00:19:39

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

如何re-sync Gemfile。锁定对Gemfile的更改。

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

假设我在Gemfile中有3颗宝石(gem1, gem2, gem3)。

bundle install creates a Gemfile.lock file.

bundle install创建了一个Gemfile。锁文件。

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.

如果我删除gem3并运行bundle install,我想要Gemfile。将重新生成锁,并从rvm gemset中删除gem3。但它没有,我应该如何重新同步而不丢掉gemset。

1 个解决方案

#1


20  

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

Gemfile。锁定与Gemfile编辑,运行bundle检查。

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

Gemfile。与Gemfile编辑和最新兼容的gems保持一致,运行bundle update。


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

相关信息:viget在博客上提供了一些关于Bundler最佳实践的建议

#1


20  

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

Gemfile。锁定与Gemfile编辑,运行bundle检查。

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

Gemfile。与Gemfile编辑和最新兼容的gems保持一致,运行bundle update。


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

相关信息:viget在博客上提供了一些关于Bundler最佳实践的建议