1 本来cocopods没有问题,最近创建项目,利用cocopods导入第三方库的时候,出现如下错误:
[!] 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
然后提示执行’pod setup’,如果出现
[!] The `master` repo is not a git repo.
然后进入 /users/你的用户名/.cocoapods/repos,删除master文件夹
然后执行:
pod setup
以上方法,亲测有效!
其他提示报错的话,一般都会有相应的提示,根据提示尝试下即可!
2,[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress Cloning into 'master
解决方法如下:
1 : 修改ruby源到https://ruby.taobao.org/
2:升级gem
sudo gem update --system 也是正常的
3:安装CocoaPods执行正常:sudo
gem install -n /usr/local/bin cocoapods
4:最后调用:pod setup