After installing Yosemite, I was unable to run brew or ruby.
I was getting this error on brew update:
/usr/local/bin/brew: /usr/local/Library/brew.r
Take a look at this tutorial here: http://ryantvenge.com/2014/09/ruby-homebrea-yosemite/
It worked for me!
This is a conglomeration from answers from other people's posts as well as a bit of digging on Google, but I figured I'd put it up so a complete answer is in one place. Specifically this gets things to work now, but also lets you do brew updates as normal and gets everything clean again.
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
. You're just changing the "1.8" that was in that line to "Current" (make sure you keep the capital "C" otherwise git will get confused later).cd $(brew --repository)
git add Library/brew.rb
git commit -m "upgrading to ruby 2.0"
brew update
(or sudo brew update
if your brew is setup to only do system changes with sudo)Credit: a lot of this came from here, though I really recommend against doing git commit -am
in your /usr/local folder.
brew update error can be fixed with this:
sudo chown -R $USER:admin /usr/local
cd /usr/local
git reset --hard origin/master
brew update
https://github.com/Homebrew/homebrew/issues/19140
This error can easily be fixed in the following steps:
1) Open terminal
2) Type nano /usr/local/Library/brew.rb
3) In the first line change “1.8″ to “Current”, so it should look like this:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
via http://blog.ic3man.gr/2014/06/homebrew-ruby-bad-interpreter-no-such-file-or-directory/
Steps to fix it:
Install command line tools for Xcode 6
Reinstall brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once brew is installed, rvm will work:
rvm install ruby
Worked for me, yahoo!
As an example I kept getting
$ 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)
I solved the problem by asking for a buddies /usr/local
folder. I then made a backup of my /usr/local
folder.
sudo mv /usr/local /usr/local.orig
I then moved his /usr/local
to mine
sudo mv ~/Downloads/local /usr/local
Note: You will likely lose some data so make sure to make a backup.