Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
36
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

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

問題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ができるようになった

参考ページ

問題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

うまく言った。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
36
Help us understand the problem. What are the problem?