MacOS 10.12 Cocoapods卸载与安装笔记

卸载

在终端中操作

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 搜索类库失败的解决办法

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

豪冷啊

你的鼓励是对我的认可!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值