Update Just One Gem with Bundler

Update just one gem with bundler

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.

Bundler - updating gems in a particular group

Yes, with

$ bundle update --conservative --group test development

Bundler’s --conservative option is key, because it prevents updates in any "Production" gem that is also a dependency of a "Test" or "Development" gem.

How to update a gem in a ruby script

Because using bundler in a single-file ruby script uses the latest constrained gem installed, in order to update one of the gems, you just have to run this (according to your example)

gem update colorize

Now your script will use the latest colorize gem version.

How to update bundler, gem-wrappers gems

(Assuming that you don't have an dependency issues) You can run a bundle update or In your Gemfile, you can remove the version numbers or get the specific version you want, and then do a bundle update.

And if you do specifically need those versions' then I guess you need to prefix the commands with bundle exec and let the bundler manage the dependencies. For example bundle exec rspec spec/...

gem update to new version but gemlock is showing version lower to the updated one

Perhaps bundler couldn't update the version because of other dependencies. All others dependencies must compatible with 4.0 version, if not then bundler will not update the gem to higher version.

Docs: https://bundler.io/v2.1/guides/using_bundler_in_applications.html#updating-gems---bundle-outdated-and-bundle-update

bundle update --conservative devise does not update only devise gem

There is an open issue about that on github.



Related Topics



Leave a reply



Submit