Ruby/Homebrew breaking with OS X 10.10 Yosemite Upgrade

Warning: I’m assuming if you have homebrew installed then you are familiar with the command line. If you aren’t familiar, don’t attempt this or ask someone that is.

Apple updated Ruby from 1.8 to 2.0 in Yosemite, so homebrew might not work and you’ll see an error like this:

/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

If you haven’t upgraded to Yosemite yet, run brew update first, and I think that will patch the Yosemite/2.0 issue.

If you have already updated, you’ll need to cheat a symlink to trick home-brew into thinking you are using 1.8 still. Run these commands:

$ cd /System/Library/Frameworks/Ruby.framework/Versions
$ sudo ln -s Current 1.8
$ brew update

Once that’s done, you should remove your symlink:

$ sudo rm 1.8

9 thoughts on “Ruby/Homebrew breaking with OS X 10.10 Yosemite Upgrade

  1. Thank you so much! Saved my a….s 🙂

  2. this does not work for me. I’m using the latest update to yosemite, and all I get when I try and update after comand 2 in the list is that you should be running lephard and higher. No update takes place, I think they might have broken something else as I know a bit abou the terminal. and I don’t thinK i broke it.

  3. sunny says:

    Thanks, Dude. This is awesome. it fixed my issue.

  4. Sir Thomas says:

    worked for me. Thanks!

  5. Justin says:

    $ sudo ln -s Current 1.8
    $ brew update
    /usr/local/Library/brew.rb:18:in `’: undefined method `help?’ for [“update”]:Array (NoMethodError)

    I just get this…(no matter what command just switch out “update” with the command)

  6. Liam Bratley says:

    Understood what was going on, but you publishing the fixing code saved me wasting a day. So thanks for your solution!

  7. Paulo says:

    In my case, I ran the following command

    /System/Library/Frameworks/Ruby.framework/Versions && sudo ln -s 2.0 1.8

    and then I could run

    brew update

  8. Daniel says:

    Thank you, this worked perfectly for me.

Leave a Reply

Your email address will not be published. Required fields are marked *