Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Ruby from OS X

We have ruby with version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]. We need uninstall ruby and install again. So we tried like this

Anshuls-Mac-mini-2:~ pankajthakur$ whereis ruby
/usr/bin/ruby
Anshuls-Mac-mini-2:~ pankajthakur$ rm -f /usr/bin/ruby
rm: /usr/bin/ruby: Permission denied

We need re-install in other location. Please guide to us.

My current MAC os Version 10.11.5 (El Capitan)

like image 904
Pavan Alapati Avatar asked Sep 15 '16 11:09

Pavan Alapati


People also ask

What is Ruby on Mac?

MacOS comes with a “system Ruby” pre-installed. If you see /usr/bin/ruby when you use the which command, it is the pre-installed macOS system Ruby. It's a bad idea to use the Mac system, Ruby, for developing Ruby applications (it's fine to use it for running utility scripts).

How do I uninstall 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.


1 Answers

I got exactly the same version on one of my computer and I used Homebrew to install the latest version and overwrite the old one.

In your terminal run brew install ruby to download the latest version and then run brew link --overwrite ruby to replace your version of Ruby.

You can also use rbenv to install and run different version of Ruby on your computer brew install rbenv.

EDIT: I think rbenv might be the easiest way to manage your Ruby environment.

like image 152
Steven Avatar answered Oct 15 '22 17:10

Steven