読者です 読者をやめる 読者になる 読者になる

万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

brew updateが出来ない時 Mac

brew update

すると、

error: unable to unlink old '.gitignore' (Permission denied)
error: unable to create file .travis.yml (Permission denied)
error: unable to unlink old '.yardopts' (Permission denied)
error: unable to unlink old 'CONTRIBUTING.md' (Permission denied)
error: unable to unlink old 'README.md' (Permission denied)
error: unable to unlink old 'SUPPORTERS.md' (Permission denied)
Warning: Could not create link for homebrew/dupes/fetchmail, as it
conflicts with Homebrew/homebrew/fetchmail. You will need to use the
fully-qualified name when referring this formula, e.g.
  brew install homebrew/dupes/fetchmail
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

なんだこれは?

適当に探したら以下の手順で書いけるできるらしい。

cd /usr/local

して

git reset --hard origin/master

してgitのリセットかけるが・・・

error: unable to unlink old '.gitignore' (Permission denied)
error: unable to create file .travis.yml (Permission denied)
error: unable to unlink old '.yardopts' (Permission denied)
error: unable to unlink old 'CONTRIBUTING.md' (Permission denied)
error: unable to unlink old 'README.md' (Permission denied)
error: unable to unlink old 'SUPPORTERS.md' (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.

結局

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

したらいけた。