Updating a single gem at a time

If you have Gemfile file in your repository you know what Bundler is.

One of the most often used command is bundle update <gem_name>. What does it do? It updates the gem together with all its dependencies.

However sometimes you want to update only a single gem to avoid any potential problem with updating too many libraries at a time. Bundler to the rescue! Since version 1.14 there is a --conservative (--source in older versions) flag which prevents Bundler from updating gem’s dependencies:

bundle update <gem_name> --conservative

You can find all available flags in the official documentation.

 

Igor Springer

I build web apps. From time to time I put my thoughts on paper. I hope that some of them will be valuable for you. To teach is to learn twice.