For example I have the following four versions installed:
capybara (2.2.1, 2.2.0.rc1, 2.1.0, 1.1.4)
Please suggest how to uninstall the capybara version 1.1.4
Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.
Description. The cleanup command removes old versions of gems from GEM_HOME that are not required to meet a dependency. If a gem is installed elsewhere in GEM_PATH the cleanup command won't delete it. If no gems are named all gems in GEM_HOME are cleaned.
When you do gem uninstall capybara
it should give you a menu asking which one you want to uninstall.
Alternatively use the -v
option.
gem uninstall capybara -v 1.1.4
Note you may need to sudo these commands if you're not using rvm.
You can also uninstall gems with version requirements using this format:
gem uninstall 'my_gem:1.0.0'
So you in your case, you would have:
gem uninstall 'capybara:1.1.4'
This also works when you want to uninstall multiple gems:
gem uninstall 'my_gem:1.0.0' 'my_other_gem:2.0.0'
OR
gem uninstall 'my_gem:1.0.0' 'my_other_gem:~>2.0.0'
So you in your case, you would have:
gem uninstall 'capybara:1.1.4' 'capybara:2.1.40'
That's all.
I hope this helps
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