0

I get the following error when I try to use brew commands.

zsh: /usr/local/bin/brew: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin: no such file or directory

I found a few threads that recommend changing the first line on the following /usr/local/Library/brew.rb file from...

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

to...

#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0

The issue is that I don't have the brew.rb file in that directory.

Do I need to create the brew.rb file and add #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0?

FYI - The file /usr/local/bin/brewcontains

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

but if I change it to

#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0

and then run the brew command I get the following error...

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': /usr/local/Library/Homebrew/extend/pathname.rb:191: 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:55:in require' from /usr/local/Library/Homebrew/global.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:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/bin/brew:17:in'

Any idea?

Thanks lot

Community
  • 1
  • 1
fs_tigre
  • 10,650
  • 13
  • 73
  • 146
  • 1
    I would try reinstalling brew. Sounds like something in its configuration is messed up and that could be the easiest solution, if it works. Hopefully it wouldn't remove any of the installed software though. – Keith Bennett Jun 07 '16 at 04:16
  • 1
    Also, have you run `brew doctor`? And `brew update`? – Keith Bennett Jun 07 '16 at 04:17
  • So reinstalling homebrew would be the best solution? I'm just afraid to loose installed software, git etc. FYI - Running `brew doctor` or brew update I also get an error. – fs_tigre Jun 08 '16 at 01:03

0 Answers0