仮想サーファーの波乗り

仮想サーファーの日常

プログラミング・エンジニアのスキルアップ・ブログ運営などに関してよく書く雑記ブログ

➡ Udemyで8/27(木)まで割引セール開催中! 1,200円〜で普段の90%以上OFF!

【brew upgradeでエラー】Error: Failure while executing: git config --local --replace-all homebrew.private true


golangのバージョンを上げようと思って「$ brew upgrade」をしたら以下のようなエラー。

$ brew upgrade go

==> Upgrading 1 outdated package, with result:
go 1.9.1 -> 1.10.3
==> Upgrading go 
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.private true


xcrunへのアクセスパスがない?最近High Sierraにアップデートした影響かな。「$ xcode-select --install」でコマンドラインツールろインストールする。

$ xcode-select --install

xcode-select: note: install requested for command line developer tools


f:id:virtual-surfer:20180714120208p:plain

インストールして良いか聞かれるからInstallを押す。と思ったらなぜか押せない。


f:id:virtual-surfer:20180714120302p:plain

別ウィンドウで同意文が表示されていた。これに同意すれば「Install」押せるようになった。


f:id:virtual-surfer:20180714120348p:plain

インストール待つ。10分くらいかかった。


もう一度golangのアップグレードしてみる。

$ brew upgrade go

...
You may wish to add the GOROOT-based install location to your PATH:
  export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
🍺  /usr/local/Cellar/go/1.10.3: 8,170 files, 336.7MB


成功!


MacOSのコマンドに関してはこの本が分かりやすかったです。

[基礎知識+リファレンス]macOSコマンド入門 ――ターミナルとコマンドライン、基本の力
西村 めぐみ (著), 新居 雅行 (監修)
技術評論社 (2017/11/18)


では。