Update just one gem with bundler

I use bundler to manage dependencies in my rails app, and I have a gem hosted in a git repository included as followed:

gem 'gem-name', :git => 'path/to/my/gem.git'

To update this gem, I execute bundle update but it also updates all the gem mentioned in Gemfile. So what is the command to update just one specific gem?


Here you can find a good explanation on the difference between

Update both gem and dependencies:

bundle update gem-name 

or

Update exclusively the gem:

bundle update --source gem-name

along with some nice examples of possible side-effects.

Update

As @Tim's answer says, as of Bundler 1.14 the officially-supported way to this is with bundle update --conservative gem-name .


执行此操作的方法是运行以下命令:

bundle update --source gem-name

您只需在命令行上指定gem名称即可:

bundle update gem-name
链接地址: http://www.djcxy.com/p/35976.html

上一篇: 捆绑商不会运行(不

下一篇: 使用捆绑器更新一个宝石