Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninstall ruby version from rbenv

Tags:

ruby

rbenv

How to uninstall or remove ruby version from rbenv. I have installed two versions of ruby. While switching to ruby 1.9.3, I am getting segmentation fault. Can anyone please help, how to remove a particular version from rbenv?

like image 681
Thillai Narayanan Avatar asked Feb 05 '12 06:02

Thillai Narayanan


People also ask

How do I uninstall Ruby from Mac Rbenv?

Uninstall Ruby on Mac with rbenv For rbenv, use rbenv versions to see which versions you have installed. Use the uninstall command to remove a version. This will remove any gems associated with the version as well. If you want to reinstall Ruby, see Install Ruby on Mac for recommendations of newer version managers.

How do I remove a specific version of Ruby?

Any gems that you install while using an RVM's ruby version, is self contained in that version. However there may come a time when you no longer want to use a particular ruby version and want to delete it along with all it's gems. Then this can be done using the “remove” command.

Does Rbenv install Ruby?

Rbenv by itself does not install Ruby implementations at all. You simply give it the path to an already installed Ruby implementation. There are several projects that make installing Ruby implementations easier.


2 Answers

New way

Use the uninstall command: rbenv uninstall [-f|--force] <version>

rbenv uninstall 2.1.0  # Uninstall Ruby 2.1.0 

Use rbenv versions to see which versions you have installed.


Old way

To remove a Ruby version from rbenv, delete the corresponding directory in ~/.rbenv/versions. E.g.

rm -rf ~/.rbenv/versions/1.9.3-p0 

Run rbenv rehash afterwards to clean up any stale shimmed binaries from the removed version.

like image 70
Sam Stephenson Avatar answered Nov 12 '22 09:11

Sam Stephenson


ruby-build now adds an uninstall command to rbenv to handle the removal of ruby versions, if you want to avoid manual rm -fr (which might be considered risky) and rbenv rehash suggested by @Stephenson. For removing ruby version 1.9.3-p0 you would run the following:

rbenv uninstall 1.9.3-p0 
like image 25
lorcan Avatar answered Nov 12 '22 09:11

lorcan