一、 CocoaPods 卸载
1、在终端中,输入 which pod 回车查看 pod 的地址 (比如:/usr/local/bin/pod)
2、删除pod:
sudo rm -rf +地址如(/usr/local/bin/pod)
3、cd /usr/local/bin 进入 pod 的位置 gem list 查看 gems 的程序包
删除cocoapods相关安装,例如:
sudo gem uninstall cocoapods -v 1.7.0.beta.3
sudo gem uninstall cocoapods-core -v 1.6.1
sudo gem uninstall cocoapods-deintegrate -v 1.0.4
sudo gem uninstall cocoapods-downloader -v 1.2.2
sudo gem uninstall cocoapods-plugins -v 1.0.0
sudo gem uninstall cocoapods-search -v 1.0.0
sudo gem uninstall cocoapods-stats -v 1.1.0
sudo gem uninstall cocoapods-trunk -v 1.3.1
sudo gem uninstall cocoapods-try -v 1.1.0
二、更新 gem 源
查看源:
$ gem sources -l
先移除现有的源:
gem sources --remove https://ruby.taobao.org/
使用新的源:
$ gem sources -a https://gems.ruby-china.com
再次 gem sources -l 查看源,出现下面打印表示成功:
*** CURRENT SOURCES ***
https://gems.ruby-china.com
三、再次安装 cocoapods
- sudo gem install -n /usr/local/bin cocoapods
- pod setup --verbose (这个比较耗时,耐心等待吧)