1.報錯:You need at least git version 1.8.5 to use CocoaPods
使用命令查看已安裝cocoapods的版本
pod
出現報錯:
[!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
有一種可能是cocoapods安裝成功了,但是鏈接Xcode的版本過低,所以需要更新Xcode。或者你電腦安裝了多個版本的Xcode,就需要修改鏈接Xcode路徑,改成鏈接電腦比較高版本的Xcode。
修改鏈接命令是:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
后面的路徑根據你較高版本Xcode路徑修改
2.使用install、update命令時,報錯:Could not automatically select an Xcode workspace. Specify one in your Podfile like so: workspace 'path/to/Workspace.xcworkspace'
解決這個問題需要先cd進入到podfile所在的文件夾,然后再執行install、update命令就沒問題了