Gem list shows two versions of a ruby ​​gem right after the gem is updated

I just updated the mime types gem update mime-types with gem update mime-types . gem list displays mime-types (1.16) before updating. After updating the gem list , mime-types (1.17.2, 1.16) displayed. Why are two versions displayed?

Additional Information: I have other Rails projects on the same computer. I did not update gem-mem types in any other projects. Running gem list from another project directory (where mime types have not been updated) displays mime-types (1.16) .

+4
source share
3 answers

You have both versions installed. If you want to remove old versions (which will not always be available due to dependencies), use gem cleanup .

+3
source

What version of RubyGems do you have? gem -v

This is interesting: I have the latest version of RubyGems, but my system behaves differently:

gem list => all gems, all versions. No matter where I call it.
gem list --local => same as before, but worldwide.

bundle list => all gems in the project (one version per stone)

The same goes for bundle update and gem update .

bundle update replaces the old version with a new one (dependencies are processed by the binder), but gem update retains both. Therefore, if you want to keep only the latest version, run gem cleanup .

bundle outdated may be useful: it displays obsolete gems in your project (based on rubygems.org)

+1
source

This may be due to gem dependencies.

For example, if another gem depends on this gem, and another gem does not have a version specified for it, and / or it is updated, and if its dependence on this gem version changes ... well, you get an idea.
Sometimes I make a bunch, and I see a bunch of new versions loading. All due to changes ... dependencies.

+1
source

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


All Articles