LoginSignup
20
6

More than 5 years have passed since last update.

OSをmojaveにしたことでgitでxcodeによるエラーが出たときの対処法

Posted at

git cloneをしたら以下のエラーが出た。

git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

前まで問題なくgit cloneできていたのだが、多分macOSをmojaveに変更したことに原因がありそうだった。

調べたところxcode-select --installを実行したら行けるようなことが書いてあった。

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

しかしだめだった。

どうやらパスが通っていないようだった。
そこでsudo xcode-select -switch /Library/Developer/CommandLineToolsを実行したするとエラーがなくなった。

https://techracho.bpsinc.jp/hachi8833/2016_09_09/25454
https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path

homebrewも使えない問題

brew updateを実行

Error: Failure while executing; `git config --local --replace-all homebrew.analyticsmessage true` exited with 71.

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developerを実行したらbrew updateでエラーは出なくなった。

まとめ

ダークモードにしたいからって、早まってmojaveにアップデートすると良くない。いろいろ弊害が出る。

20
6
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
20
6