[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`. Y...

$ pod install

Analyzing dependencies
Cloning spec repo cocoapods from https://github.com/CocoaPods/Specs.git
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named cocoapods.
You can try adding it manually in /Users/fanxianchao/.cocoapods/repos or via pod repo add.

  • 解决:
更换国内的镜像, 清华的不错
$ cd ~/.cocoapods/repos 
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
然后记得去自己项目podfile里把source换了

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
再重新pod update
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。