42
36

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mac でbrew がおかしくなった(brew updateができない)のを解決

Last updated at Posted at 2016-05-22

#問題1

 /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 -- utils/popen (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/utils.rb:6: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:9: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:16:in `<main>'

のようなというエラーが出て、Brewが何もできない

解決策

cd /usr/local/
git status

とすると、いろいろおかしくなってるので、

git reset --hard && git clean -df

これで、GitRepoが綺麗になり、brewができるようになった

##参考ページ
http://stackoverflow.com/questions/24652996/homebrew-not-working-on-osx

問題2 brew updateができない

warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
fatal: cannot create directory at '.github': Permission denied
Error: Failure while executing: git pull --quiet origin refs/heads/master:refs/remotes/origin/master

というエラーがでた

そこでGoogleと、

このページにたどり着く!

そして、グッドボタンが押されてるのを見てみると

sudo chown -R $(whoami):admin /usr/local
cd $(brew --prefix) && git fetch origin && git reset --hard origin/master

してから、

brew update

すればよいと書いてある!

成功!!!

おまけ

brew updateすると、最後に

Error: Could not link caskroom/cask manpages to:
  /usr/local/share/man/man1/brew-cask.1

Please delete these files and run `brew tap --repair`.

というのが出ているので、次いでに調べるとQiitaにすでに投稿がある!
http://qiita.com/armorik83/items/de7c5a5a8785de6ea815
こちらを参考にして、一個目の修正を試すと

brew uninstall --force brew-cask; brew update

うまく言った。

42
36
0

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
42
36

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?