今天由于要新增一个第三方,所以我很熟练的vim Podfile
巴拉巴拉巴拉然后再 pod install,接下来就懵逼了。。。。
报如下错误:
12345678910
Setting up CocoaPods master repo
$ /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
[!] Failed: /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
$ /usr/bin/git checkout master
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
[!] Failed: /usr/bin/git checkout master
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
(The `master` repo is not a git repo.)
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
试了几次都不行,又换pod update还是不行,于是我开始怀疑是不是COcoaPods炸了,还是我升级了系统之后炸了。。。。想想不科学,应该是XCode的问题,仔细阅读错误(原谅我英文差),貌似看懂了那么一点,可能是我删了XCode又恢复导致的。就这么一百度果然还真是的。
一句命令搞定:sudo xcode-select –switch /Applications/Xcode.app(后面的地址直接打开程序把Xcode往这里拖即可)。完事后再pod install。。biubiubiu出现了熟悉的“Analyzing dependencies”字样,最后提示“Pod installation complete! There are 15 dependencies from the Podfile and 16 total pods installed.”。ok成功了。