Rails: Uninstall specific version of a library using gem

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