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