5

OS X El Capitan version 10.11.2

I attempted brew update, but this error message is displayed.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
    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/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: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/Library/Homebrew/global.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: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/Library/brew.rb:15:in `<main>'

I also attempted brew install zsh, but the above message is displayed.

Please let me know how to fix this error message.

bfontaine
  • 18,169
  • 13
  • 73
  • 107
  • 1
    Looks like your version of ruby is too old or your install of brew is broke. – bmargulies Feb 28 '16 at 14:36
  • Your version of Ruby is fine. Does the `brew update` error happens again if you run `brew update` a second time? – bfontaine Feb 29 '16 at 10:15
  • i'm facing the same issue. although brew was working fine with me before. i'm guessing it happened after i upgraded my system to El Capitan. – dima Mar 03 '16 at 11:55

1 Answers1

4

Found an answer which worked for me here: https://stackoverflow.com/a/35495897/1354137

The problem mainly occurs after updating OS X to El Capitan (OS X 10.11). This is mainly because of file permission issues with file El Capitan’s new SIP process. Try changing permissions of /usr/local directory.

$ sudo chown -R $(whoami):admin /usr/local  

If it still doesn't work, use following steps and everything will be fine. This may be because homebrew is not updated.

1. open terminal  
2. $ cd /usr/local  
3. $ git reset --hard  
4. $ git clean -df
5. $ brew update
Community
  • 1
  • 1
alexvance
  • 1,114
  • 1
  • 11
  • 31