6

I recently decided to uninstall RVM from my system. Some of the arguments made at this page convinced me:

Actually, what I decided, however, is that I don't want to worry about multiple versions of Ruby at all. I just want to use version 1.9.2-p290 and not worry about anything else. When I run ruby --version on my Mac, though, it tells me I have version 1.8.7. I have looked around for how to simply uninstall this Ruby from my Mac, but I haven't found anything, weirdly. It seems that the only people who ever want to uninstall Ruby run linux and everyone using a Mac recommends RVM.

How do I uninstall Ruby 1.8.7 from my Mac? I'd like to move to version 1.9.2-p290 and I'd like to have only one version on my system.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Deonomo
  • 1,583
  • 3
  • 16
  • 25
  • 1
    The base 1.8.7 Ruby (known as "System" Ruby) on macs is required by the system and cannot be removed, even with sudo. The only option is to replace it with a separate installation and change the PATH as @Winfield says. – tscho Sep 06 '11 at 22:35
  • As @t_scho says, do NOT remove 1.8.7. Apple installed it for their purposes. You can use `find /usr -type f -name \*.rb` to get an idea what uses it. – the Tin Man Sep 07 '11 at 00:16
  • Duplicate of [Upgrading Ruby on Mac OS X](http://stackoverflow.com/questions/3454792/upgrading-ruby-on-mac-os-x), [How to Upgrade to Ruby 1.9.2](http://stackoverflow.com/questions/4546573/how-to-upgrade-to-ruby-1-9-2), and more. – Phrogz Sep 07 '11 at 02:49

2 Answers2

7

It's easier to install a new version of ruby and just update your path so that all of the binaries reference your new installation. I do this locally with REE (installed in /opt/ruby-enterprise-1.8.7-2010.02)

export PATH=/opt/ruby-enterprise-1.8.7-2010.02/bin:$PATH

$> which ruby
/opt/ruby-enterprise-1.8.7-2010.02/bin/ruby

You don't get the advantage (or complexity) of hot-swapping ruby interpreters on the fly like RVM, but I set this up when I built this dev system and have never had to change it.

Since ruby comes with OSX, I don't recommend trying to remove it, just work-around the system version.

Winfield
  • 18,985
  • 3
  • 52
  • 65
  • Thanks. I'm going to try and install 1.9.2-p290 from source and then point all my work to that. Look for another question on here soon regarding why I am having some difficulty installing from source. – Deonomo Sep 07 '11 at 01:08
  • Feel free to contact me at winfield.peterson@gmail.com if you want help getting it setup. You may be better off using homebrew or macports vs. installing for source. – Winfield Sep 07 '11 at 01:53
2

You should go with macports and install ruby19 port:

sudo port install ruby19 +nosuffix

The new ruby version will take precedence over the preinstalled one.

Filipe Miguel Fonseca
  • 6,400
  • 1
  • 31
  • 26