Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reinstall Ruby on OS X

Tags:

macos

ruby

I've gone and messed up Ruby on my Snow Leopard Machine. I've managed to introduce all sorts of issues and I'm having a hard time cleaning things up.

What are the steps to get me back to square one with Ruby? I'm fairly new to programming so I need it spelled out for me!

like image 405
Colin Avatar asked Mar 08 '11 01:03

Colin


People also ask

How do I uninstall and install Ruby on 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.

How do I know if Ruby is installed on my Mac?

Pre-installed macOS system Ruby 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.

Does OSX include Ruby?

First of all, Ruby is already pre-installed on your Mac. However, the pre-installed version is a few versions behind so we'll look into the other ways to install Ruby. Using a package management system makes your life easier when installing any software. On a Mac, you can use Homebrew to install newer versions of Ruby.


2 Answers

It sounds like what you probably want to do is clear out all your globally installed gems in the system Ruby. This can be done by running the following:

sudo rm -rf /Library/Ruby/Gems/*

This will leave all the gems that come with OS X (which is a good thing, since some apps may assume they're installed).

As macarthy said, I also highly recommend using a Ruby version manager (e.g. rbenv or RVM) to more easily install, remove, and manage Ruby versions.

like image 79
Andrew Marshall Avatar answered Oct 31 '22 01:10

Andrew Marshall


My suggestion would be to forget about what you have and use RVM

  • https://rvm.io

you can basically ignore what you have installed then.

like image 27
macarthy Avatar answered Oct 31 '22 01:10

macarthy