As I mentioned before, I upgraded to ruby 1.8.7 and decided to use —prefix=/usr, i.e. overwriting existing ruby 1.8.6. Big mistake. After some issues I decided to roll back completely.
This is what I did (luckily I can copy the required files from my wife’s Macbook).
OS X ruby framework overview
The framework is /System/Library/Frameworks/Ruby.framework
- /usr/lib/ruby is a softlink to osx ruby framework
- osx ruby framework’s site_ruby is a softlinke to /Library/Ruby/Site
To fix
- /usr/bin
- osx ruby framework
- /Library/Ruby/Site
Actions
Rename the following directories then copy the same directories from another OS X
- /System/Library/Frameworks/Ruby.framework
- /Library/Ruby/Site
Make sure the following files are links to os x ruby framework’s /usr/bin
- /usr/bin/erb
- /usr/bin/irb
- /usr/bin/rdoc
- /usr/bin/ri
- /usr/bin/ruby
- /usr/bin/testrb
Cleanup
Remove these backup directories afterwards (once everything is ok)
- os x ruby framework .bak
- /Library/Ruby/Site.bak
- /usr/lib/ruby/site_ruby.bak
- /usr/lib/ruby/user-gems.bak
Now
- link /usr/lib/ruby/site_ruby to /Library/Ruby/Site
- link /usr/lib/ruby/user-gems to /Library/Ruby/Gems