Brew is Failing with Crazy Error

If you're on Mavericks and you're using Homebrew, you may have experienced a weird error message.

</p>

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': /usr/local/Library/Homebrew/download_strategy.rb:88: invalid multibyte escape: /^\037\213/ (SyntaxError)

</p>

This seems to be caused by an update to Ruby version 2.0 as part of Mavericks. All you need to do is make sure that Homebrew points specifically to the 1.8 version of Ruby.

</p>

Edit /usr/local/bin/brew

</p>

Change the first line from

</p>

#!/usr/bin/ruby

</p>

to

</p>

 #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

</p>

Run a brew update afterwards. If brew update works, you're good to go. If it fails, you might need to go nuclear on this bitch. Understand this will probably trash any custom formulas you have.

</p>

cd /usr/local
git reset --hard origin/master
git clean -df

</p>

Hopefully that solves your problem.

</p>

comments powered by Disqus