Wednesday, November 05, 2014

RVM Homebrew problem on Mac OS X Yosemite

I was trying to update Ruby to 2.1.4 using RVM (Ruby Version Manager). Then I encountered an error:

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
ERROR: '/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.
Unable to install ruby ruby-2.1.4. Please install it manually to continue.

It was because I updated Mac OS X to Yosemite, which has default Ruby version 2.0 (/System/Library/Frameworks/Ruby.framework/Versions/2.0).

I tried various suggested solutions. But they didn't work.

In the end, I created a symbolic link /System/Library/Frameworks/Ruby.framework/Versions/1.8 from /System/Library/Frameworks/Ruby.framework/Versions/Current, which is also a symbolic link from /System/Library/Frameworks/Ruby.framework/Versions/1.8.

Then updating Ruby succeeded.

1 comment:

wintersky said...

Hi
I'm experiencing the exact same problem when I tried to update Ruby to 2.3.1. So I tried to follow your suggest of creating a symbolic link but I got the Operating not permitted error.
This is what I did:
$ cd /System/Library/Frameworks/Ruby.framework/Versions/
$ ls
total 8
drwxr-xr-x 6 root wheel 204 Mar 12 09:09 2.0/
lrwxr-xr-x 1 root wheel 3 Apr 1 12:21 Current@ -> 2.0

I then typed:
$ ln -s 2.0 1.8
ln: 1.8: Operation not permitted

It turned out that inside the /System directory and everything below is Read Only.

So, how did you get around this problem? Any help would be much appreciated. Thanks

Moe