報(bào)錯(cuò)內(nèi)容如下:
/Users/zsp/.rvm/gems/ruby-2.3.0@global/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:118:in
git_version': Failed to extract git version fromgit --version` ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n") (RuntimeError)
雖然看上去是git出了問題,但看報(bào)錯(cuò)估計(jì)很多其他的工具都會(huì)引發(fā)這個(gè)報(bào)錯(cuò),谷歌一查,果然非常多類似問題!
記錄一下解決辦法:
終端執(zhí)行xcode-select --install
通過終端重新安裝的Xcode命令行工具使用(其實(shí)這里安裝的是Command Line Tools,Command Line
Tools是在Xcode中的一款工具)