卸载
在终端中操作
1.which pod
查看 pod 安装地址
/usr/local/bin/pod
2.sudo rm -rf /usr/local/bin/pod
删除 pod
3.gem list
查看 cocoapods 安装包的位置
*** LOCAL GEMS ***
activesupport (4.2.7.1)
atomos (0.1.2)
bigdecimal (default: 1.2.0)
CFPropertyList (2.3.5, 2.2.8)
claide (1.0.2, 1.0.1)
cocoa (0.1.6)
cocoapods (1.4.0)
cocoapods-core (1.4.0, 1.4.0.beta.2)
cocoapods-deintegrate (1.0.2, 1.0.1)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.0, 1.1.2)
cocoapods-try (1.1.0)
......
4.sudo gem uninstall cocoapods -v 1.4.0
删除 cocoapods
5.sudo gem uninstall cocoapods-core -v 1.4.0
删除 cocoapods-core
6.pod
检查是否删除成功
-bash: pod: command not found
证明删除成功
安装
1.gem sources -l
查看镜像源
*** CURRENT SOURCES ***
https://ruby.taobao.org/
这个已经不可用了
2.gem sources --remove https://ruby.taobao.org/
删除镜像源
https://ruby.taobao.org/ removed from sources
3.gem sources -a https://gems.ruby-china.org/
添加镜像源
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
https://gems.ruby-china.org/ added to sources
4.gem sources -l
再次查看镜像源
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
5.sudo gem install -n /usr/local/bin cocoapods
安装
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Successfully installed cocoapods-1.4.0
Parsing documentation for cocoapods-1.4.0
1 gem installed
6.pod setup
Setting up CocoaPods master repo
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
失败!!!
7.git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
fatal: destination path '/Users/haocold/.cocoapods/repos/master' already exists and is not an empty directory.
失败!!!
8.cd ~/.cocoapods/repos
把master
文件夹删除
再执行 7
等待.
等待..
等待...
完成!
问题
1.[!] Unable to find a pod with name, author, summary, or description matching
要先 pod setup
2.pod setup
结果
Setting up CocoaPods master repo
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
3.rm ~/Library/Caches/CocoaPods/search_index.json
删除~/Library/Caches/CocoaPods目录下的search_index.json文件
再执行 pod search
Creating search index for spec repo 'master'..
4.完成!!!
后续
1.macOS 更新到 10.13.1
后
pod 又不行了: -bash: pod: command not found
2.安装sudo gem install -n /usr/local/bin cocoapods
遇到 ERROR:
ERROR: While executing gem ... (TypeError) no implicit conversion of nil into String
3.先执行命令:sudo gem update --system
再安装
参考:
如何从电脑中卸载cocoapods
mac 10.12系统下的CocoaPods出现的问题,安装卸载及使用
CocoaPods安装、卸载、使用说明(Mac ox 10.11+)
CocoaPods: pod search 搜索类库失败的解决办法