I just updated the mime-types gem with gem update mime-types
. gem list
displayed mime-types (1.16)
prior to updating. After the update gem list
shows mime-types (1.17.2, 1.16)
. Why are two version displayed?
More info: I have other Rails projects on the same computer. I have not updated the mime-types gem in any other projects. Running gem list
from another project's directory (where mime-types has not been updated) displays mime-types (1.16)
.
You have both versions installed. If you want to delete old versions (which will not always will be possible due to dependencies) use gem cleanup
.
Which version of RubyGems do you have? gem -v
This is interesting: I have the newest version of RubyGems but my system behaves differently:
gem list
=> all the gems, all the versions. No matter from where I call it.gem list --local
=> same as before but user-wide.
bundle list
=> all the gems in a project (one version per gem)
The same goes for bundle update
and gem update
.
bundle update
replaces the old version by the new one (the dependencies are taken care by bundler), but gem update
keeps both. So if you want to keep only the newest version, run gem cleanup
.
bundle outdated
might be useful: it displays the outdated gems in your project (based on rubygems.org)
This can happen because of gem dependencies.
For example if another gem depends on that gem, and the other gem does not have a version specified for it, and(/or) it gets updated and if its dependency on that gem's version changes... well you get the idea.
Sometimes I do a bundle and I see a ton of new versions getting downloaded. All due to changed... dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With