LoginSignup
6
5

More than 5 years have passed since last update.

El Capitanでhomebrewできなくなっていたのを解決

Last updated at Posted at 2016-07-17

El Capitanでhomebrewができなくなっていた

brew updateしたら以下のエラーがでて、アップデートができなかった。brew doctorをしてもダメで、homebrewが全部使えなくなっていた。El Captanで新たに追加されたSystem Integrity Protectionという新機能が原因らしい、homebrew本体をリセットすることで解決するとのこと。

/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)

そこまで複雑でないので、ググれば解決する問題だけど一応メモしておきます。

解決方法

homebrewのリセットと/usr/local以下の権限を自分に付与

手順1./usr/localへ移動し、git reset&git clean

cd /usr/local
git reset --hard && git clean -df

試しに、'brew doctor'するが、パーミッションがないと以下のエラーがでるので、/usr/local以下の書き込み権限を自分に付与

warning: unable to unlink .yardopts: Permission denied
warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
fatal: cannot create directory at '.github': Permission denied

手順2./usr/local以下の書き込み権限を自分に付与

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

これで、homebrewが使えるようになったはず。

僕の環境は、homebrew-caskがインストールされており、これも直す必要がありました。具体的にはuntap(レポジトリの修正)し`brew tap --repairを行います。

brew untap caskroom/homebrew-cask
brew tap --repair

参考

6
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5