pod install
- [!]Unable to add a source with url
$ pod install
pod[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
$ pod repo add master https://github.com/CocoaPods/Specs.git
[!] To setup the master specs repo, please run `pod setup`.
$ pod setup
- [!] Unable to find a specification
$ pod install
Analyzing dependencies
[!] Unable to find a specification for `AFNetworking~>3.0`
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
// 解决办法:
// 移除本地master
sudo rm -rf ~/.cocoapods/repos/master
// 移除本地缓存
sudo rm -rf ~/Library/Caches/CocoaPods/
// 重新setup,如果网速较慢,可以在后面加上 --verbose
pod setup
//10.14后
pod install --repo-update
- pod[!] The
master
repo is not a git repo.
$ pod install
pod[!] The `master` repo is not a git repo.
$ rm -rf ~/.cocoapods/repos/master
pod setup
pod search抽风
$ pod search SDWebImage
[!] Unable to find a pod with name, author, summary, or description matching `SDWebImage `
//1.执行
$ pod setup
//2.如果没有解决问题,就继续第二步
cd ~/Library/Caches/CocoaPods/
rm search_index.json
//OK.
如果是安装多个Xcdoe,还需要选择Xcode的路径
sudo xcode-select -switch /Applications/Xcode.app/
在终端里输入下方命令可以知道Xcode的路径:
xcode-select -p