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
インストールして良いか聞かれるからInstallを押す。と思ったらなぜか押せない。
別ウィンドウで同意文が表示されていた。これに同意すれば「Install」押せるようになった。
インストール待つ。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) |
では。