How can you view the updates that the “Bundle Update” will take place?

Sometimes I want to start updating a package, but only in order to find out which stones need updating. I do not necessarily want to deal with the problems associated with updating all of them, but I want to do a quick check to find out what is from the prior art.

Is there a way to simply get the Bundler to list the gems that need to be updated together (ideally) with the version I'm currently running, and which is the latest and largest?

+6
source share
4 answers

I tried this:

> gem install bundle_outdated > bundle-outdated Finding outdated gems.. Newer versions found for: rails (3.1.0 > 3.0.0) haml (3.1.2 > 3.0.0) rspec-rails (2.6.1 > 2.0.1) Lock bundle to these versions by putting the following in your Gemfile: gem 'rails', '3.1.0' gem 'haml', '3.1.2' gem 'rspec-rails', '2.6.1' You may try to update non-specific dependencies via: $ bundle update haml rspec-rails Handwaving specifications: haml: >= 3.0.0 rspec-rails: >= 2.0.1 

Another alternative:

 > gem install gem-outdated > gem outdated 
+3
source

Now there is a way to do this directly using bundler. You do not need to install additional gems.

 bundle outdated 

will return something like this

 Outdated gems included in the bundle: * acts-as-taggable-on (2.4.1 > 2.3.3) * addressable (2.3.4 > 2.3.3) * arel (4.0.0 > 3.0.2) * better_errors (0.8.0 > 0.7.2) * builder (3.2.0 > 3.0.4) * capybara (2.1.0 > 2.0.3) * chunky_png (1.2.8 > 1.2.7) * codemirror-rails (3.12 > 3.02) * coffee-rails (4.0.0 > 3.2.2) ..... 
+14
source

Since google search queries fall on this page and the answers provided have some points that need attention, I will add another answer.

If you want to know which updates are released for your gems, given the " version requirements in your Gemfile", use:

 bundle outdated --strict 

If you don't want to consider version dependency, just use bundle outdated as mentioned in other answers.

Secondly, if you want to update a specific stone, use:

 bundle update --source gemname 

bundle update gemname updates the gem and all its dependencies that may leave you in a mess (even the rails are updated using bundle update haml ).

+5
source

It is not possible to do this directly using bundler, but while you are using VCS, you can always return Gemfile.lock to revert the changes made during the upgrade, or split the file to see what changes have been made. See This Related Question

0
source

Source: https://habr.com/ru/post/896400/


All Articles