Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall ruby installed by ruby-install

Tags:

I have many rubies installed by ruby-install under ~/.rubies:

ls .rubies ruby-1.9.3-p545 ruby-2.0.0-p598 ruby-2.1.3      ruby-2.1.5 ruby-2.0.0-p451 ruby-2.1.2      ruby-2.1.4      ruby-2.2.0 

I want to uninstall one of the ruby installed by ruby-install, How do I do that?

like image 284
Juanito Fatas Avatar asked Dec 27 '14 07:12

Juanito Fatas


People also ask

How do I remove a specific version of Ruby?

Use rbenv versions to see which versions you have installed. To remove a Ruby version from rbenv, delete the corresponding directory in ~/. rbenv/versions .

How do I completely remove Ruby from my Mac?

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.


1 Answers

Unfortunately appears that ruby-install just downloads and compiles Ruby, with no option to remove it, unlike RVM or rbenv.

So, probably you'll need to run some manual commands here to delete all installed files.

1. Locate it

Usually ruby-install will install rubies in ~/.rubies/ folder.

If you're not sure which ruby was installed using ruby-install, locate the file .installed.list, as it has a list of installed files during Ruby install. If you want to quickly locate it, just run locate .installed.list and you'll get a short list of them.

Then run a cat on the file located at the version you want to remove, to make sure which is the root folder for the ruby install you want to delete.

2. Remove it

Then you can just remove the folder where the target version is located.

If you want to remove ruby-1.9.3-p545, run:

rm -Rf ~/.rubies/ruby-1.9.3-p545 
like image 145
Rael Gugelmin Cunha Avatar answered Oct 24 '22 07:10

Rael Gugelmin Cunha