Is it possible? I'm running into various issues at least once a week since it got corrupted or something, especially with homebrew.

If it is possible, but would just be a better idea to start from a clean slate, please let me know.

  • My PATH settings: gist.github.com/506481
    – LBRapid
    Aug 3, 2010 at 14:37
  • From your path the /opt/local entries suggest that you have macports as well. what does which ruby show?
    – mmmmmm
    Aug 3, 2010 at 15:04
  • I do have macports installed, but using which ruby is just going to show the rvm ruby version. The issues I run into are when trying to use something like homebrew or autotest
    – LBRapid
    Aug 4, 2010 at 14:20
  • Just follow this article: superuser.com/questions/860819/…
    – Michallis
    Aug 31, 2015 at 9:36

5 Answers 5


In my understanding -- please correct me if I am wrong -- you don't have to reinstall all of Mac OS X to reinstall your system Ruby. As you may know, the System Ruby lives in /System/Library/Frameworks/Ruby.framework/. If that folder is deleted or corrupted, or if the symlinks that point to it are deleted or changed, you won't have a working System Ruby install.

To fix, try this:

  1. Insert your Mac OS X Install DVD
  2. Open the Mac OS X Install DVD folder
  3. Open the Optional Installs folder
  4. Open the Xcode Tools folder
  5. Open the XcodeTools package. This will start the Xcode Tools Installer. Follow the instructions.

It also doesn't hurt to get the latest Xcode from http://developer.apple.com/technologies/xcode.html

Full disclosure: I have done these steps. I'm pretty sure it restores the Ruby.framework, but it has not restored the symlinks (typically in /usr/bin) for me.

  • This solution is pretty good, and although I didn't follow it, it was eventually suggested from a coworker. I ended up just reinstallting ruby 1.8.7 to /usr/local from source and then symlinking it to where homebrew needed it. I just needed rvm and homebrew to be operable until I get a new computer next month. So this'll do :) Thanks for your response!
    – LBRapid
    Aug 15, 2010 at 2:51
  • 1
    Could you please update this for Yosemite using the AppStore installed bundle
    – rraallvv
    Jan 3, 2015 at 15:22
  • @rraallvv I'm not sure what you mean. May I suggest that if the steps above aren't working for you, then (a) be more specific, or (b) create a new answer showing what worked for you, or (c) create a new question, referencing this one.
    – David J.
    Jan 3, 2015 at 18:00
  • I've created a new question with the details.
    – rraallvv
    Jan 5, 2015 at 15:58

If you use Pacifist then it's possible to just reinstall Ruby.

  1. Insert your OS X DVD
  2. Run Pacifist
  3. Select "Open Apple Install Discs"
  4. Select the disc
  5. Search "Ruby.framework"
  6. Right click and select "Install to Default Location"

This will reinstall Ruby, to setup the symlinks from /usr/bin to point to it use Pacifist again:

  1. Search "Contents of BSD.pkg"
  2. Open: usr -> bin
  3. Select the links and files that you require
    • cap
    • capify
    • erb
    • ferret-browser
    • gem
    • gpgen
    • irb
    • mongrel_rails
    • rails
    • rake
    • rb-keygen
    • rdoc
    • redcloth
    • ri
    • ruby
    • testrb
    • update_rubygems
  4. Right click and select "Install to Default Location"

In general if you need to figure out what installer a file came from on your system in a terminal:

$ pkgutil --file-info /usr/bin/ruby
volume: /
path: usr/bin/ruby

pkgid: com.apple.pkg.BSD
install-time: 1203610823
uid: 0
gid: 0
mode: 120755

The pkgid should then give you a hint, and then you either find that installer and run it again or use Pacifist to selectively do it.

You can also see what other files are in that package with:

$ pkgutil --files com.apple.pkg.BSD

I've found the best way to deal with Ruby on OS X is to get your system to the default state with the above process. Remove any MacPort, Fink or versions you have manually compiled. Install RVM and use that to manage installing newer versions.

Turns out that I had removed my system Ruby and had problems installing pow (http://pow.cx) on my mac because of it. So I installed Pacifist and followed the advice in this post and am back in business. Thanks!

  • Pacifist (Version 3.2.17) gets stuck when trying to install Ruby.framework on Yosemite
    – rraallvv
    Jan 3, 2015 at 15:21

Old post, but I was just switching from ports to homebrew so...

For homebrew issues, I resolved it by installing rvm and symlinking. So if you have rvm installed you can can start by typing:

which ruby

with the output of that do something like:

ln -s /Users/username/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /usr/bin/ruby

I made a real mess of my Ruby installation on OSX but I used this GUI from the RVM team and managed to resolve it with little effort and no hacking around on a CLI



IMO Homebrew (http://brew.sh) is the best package manager for OS X.

To install Homebrew do:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


brew install ruby


  • 12
    To install Ruby, use Ruby to install it via Homebrew...
    – whirlwin
    Jun 18, 2014 at 12:57
  • 1
    haha, inception :D Sep 8, 2020 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.