Rails: Uninstall specific version of a library using gem

32,639

Solution 1

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.

Solution 2

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

Share:
32,639
Prashanth Sams
Author by

Prashanth Sams

Author of Selenium Essentials O'Reilly | PacktPub | Amazon.in | Amazon.com | Amazon (Kindle) | Google | Barnes&Noble | Apple Store Selenium WebDriver, Appium, API, Locust, Cucumber, Docker, Helm, Kubernetes, Jenkins, Jenkins job-dsl, AWS, Git, Github, Gitlab, Ruby, Python, JavaScript, TypeScript, Groovy, Shell, Protractor, Java, Grafana, Prometheus, Datadog, Graphite, CasperJS, Behave, JBehave Blog: http://www.seleniumworks.com/ https://devopsqa.wordpress.com/ Skype: prashanth.sams Official Site: http://prashanthsams.com Twitter: https://twitter.com/prashanthsams GitHub: https://github.com/prashanth-sams LinkedIn: https://www.linkedin.com/in/prashanth-sams-58208953/ Google+: https://plus.google.com/u/0/104394276212961437513/posts Facebook: https://www.facebook.com/groups/selenimusers/

Updated on July 09, 2022

Comments

  • Prashanth Sams
    Prashanth Sams almost 2 years

    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