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
How to Map/Collect with Index in Ruby
Tell Ruby Program to Wait Some Amount of Time
How to Invoke an Instance Method on a Ruby Module Without Including It
Rvm Is Not a Function, Selecting Rubies with 'Rvm Use ...' Will Not Work
How to Know What Is Not Thread-Safe in Ruby
Where to Define Custom Error Types in Ruby And/Or Rails
How to Run a Single Test in Minitest
Welcome/Home Page in Ruby on Rails - Best Practice
Ubuntu Rails Install Fails on Zlib
How to Install Rvm System Requirements Without Giving Sudo Access for Rvm User
How to Test a File Upload in Rails
File Upload with Activeadmin Rails Using Paperclip
How to Sort an Array of Hashes by a Value in the Hash
Can Someone Explain the Class.Superclass.Class.Superclass Paradox
How to Check If a Given Directory Exists in Ruby
Differencebetween Send_Data and Send_File in Ruby on Rails
How to Have Multiple Versions of Ruby and Rails, and Their Combinations on Windows