MacBook-Pro:XXX xx$ pod install
Analyzing dependencies
Cloning spec repo `edu-git-cocoapods-specs` from `https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git` named `edu-git-cocoapods-specs`.
You can try adding it manually in `/Users/xx/.cocoapods/repos` or via `pod repo add`.
我查看了一下源 pod repo
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/zhanghuan/.cocoapods/repos/master
遇到问题不要慌 百度 a few minutes later ...
网上有好多推荐方法 试了一下 好像没啥用
最直接的方法
打开~/.cocoapods/repos/master 文件夹 找到.git文件里面的config 打开
里面url=https://github.com/CocoaPods/Specs.git 替换成https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git command+s 关闭文件夹
pod repo 查看下master源
要强调下podfile里面要指定source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'切记切记
更改成功后 继续pod install
网友评论