45

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

2 Answers 2

96

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.

0
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.