This repository has been archived by the owner. It is now read-only.

brew error: invalid multibyte escape : /^\037\235/ after updating to OSX Mavericks #23655

Closed
antonydeepak opened this Issue Oct 27, 2013 · 13 comments

Comments

Projects
None yet
8 participants
@antonydeepak
Copy link

antonydeepak commented Oct 27, 2013

Hello:

Not sure if this is causation or correlation, but after my OSX Mavericks update, brew command started failing with this message

/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) invalid multibyte escape: /^\037\235/ invalid multibyte escape: /^\xFD7zXZ\x00/ from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/Library/Homebrew/formula.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/Library/Homebrew/tab.rb:3:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/Library/Homebrew/bottles.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/Library/Homebrew/extend/pathname.rb:2:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/Library/Homebrew/global.rb:1:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/bin/brew:10:in

'

@mistydemeo

This comment has been minimized.

Copy link
Contributor

mistydemeo commented Oct 27, 2013

It looks like you're using Ruby 2.0; however, Homebrew is hardcoded to use the Ruby 1.8 that comes with OS X. Have you modified your install of Homebrew at all?

@ghost

This comment has been minimized.

Copy link

ghost commented Oct 27, 2013

Ruby 2.0 is default ruby on Mavericks.

@mistydemeo

This comment has been minimized.

Copy link
Contributor

mistydemeo commented Oct 27, 2013

Homebrew doesn't use /usr/bin/ruby, but hardcodes to /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby. This still exists in 10.9, and is Ruby 1.8.7.

@antonydeepak

This comment has been minimized.

Copy link

antonydeepak commented Oct 27, 2013

I have not modified homebrew, atleast not intentionally. So, is there a config file that I can change to make ruby look for v1.8? I tried grepping /usr/local/library/homebrew and found places where it is looking for v1.8, but not sure if those are the appropriate places to change it.

@jacknagel

This comment has been minimized.

Copy link
Contributor

jacknagel commented Oct 27, 2013

@mistydemeo basd on the backtrace, I think this installation of Homebrew predates the point at which we started hardcoding 1.8.

/usr/local/Library/Homebrew/download_strategy.rb:88: invalid multibyte escape: /^\037\213/ (SyntaxError)

This regexp isn't even in this file anymore (since 52732da).

@adamv

This comment has been minimized.

Copy link
Contributor

adamv commented Oct 28, 2013

What does your brew --config look like?

@cmd

This comment has been minimized.

Copy link

cmd commented Oct 28, 2013

I had this problem, and changed the first line of /usr/local/bin/brew to use the right path as per mistydemeo. Then I did a brew list and noted the output, and removed brew and reinstalled it from the homebrew site. Then just reinstalled everything from my list. Bit of a pain, but everything's back.

@mistydemeo

This comment has been minimized.

Copy link
Contributor

mistydemeo commented Oct 28, 2013

This can probably just be fixed by doing a brew update.

@antonydeepak

This comment has been minimized.

Copy link

antonydeepak commented Oct 28, 2013

Nope, just the command 'brew' blows; so none of its variants (brew update,brew --config) works.
@jacknagel maybe right since it has been a long time since I updated my brew version.
I will try @cmd suggestion.

@antonydeepak

This comment has been minimized.

Copy link

antonydeepak commented Oct 28, 2013

Resolved!! Thanks everyone.

Rootcause :
OSX Mavericks update defaults to v2.0 of ruby and this breaks v0.8.1 of Homebrew

Resolution:

  1. Change the hashbang of /usr/local/bin/brew file to point to v1.8 of ruby. brew should start to work again.
  2. Do a brew update

Everything should be back to normal

@adamv adamv closed this Oct 28, 2013

@hectorcorrea

This comment has been minimized.

Copy link

hectorcorrea commented Nov 26, 2013

As mistydemeo suggested, "brew update ." did the trick for me.

@peterept

This comment has been minimized.

Copy link

peterept commented Dec 6, 2013

Thank you for this!!! i upgraded to Mavericks and had the same issue.

Changed first line in /usr/local/bin/brew to:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@svassr

This comment has been minimized.

Copy link

svassr commented Apr 25, 2014

I had to replace symbolic link
/usr/bin/ruby -> /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
with
/usr/bin/ruby -> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
update and then put it back again :

sudo ln -svf  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /usr/bin/ruby
sudo brew update
sudo ln -svf /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby /usr/bin/ruby
brew --config

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.