一般情况下需要卸载
Cocoapods
只需要执行$ sudo gem uninstall cocoapods
即可, 但通常情况下我们很少会需要卸载Cocoapods
, 往往是在排查问题无效需要重新部署环境时才会需要这个环节, 下面是我在处理Cocoapods
问题时尝试过最有效的清理方式
1. 移除pod
组件
shenyj@ShenYj-MBP ~ % which pod
/usr/local/bin/pod
shenyj@ShenYj-MBP ~ % sudo rm -rf /usr/local/bin/pod
2. 移除 RubyGems
中的 Cocoapods
程序包
$ sudo gem uninstall cocoapods
3. 查看本地安装过的Cocoapods
相关内容, 并彻底清除:
$ gem list --local | grep cocoapods
shenyj@ShenYj-MBP ~ % gem list --local | grep cocoapods
cocoapods-core (1.9.1)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.3.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.4.1)
cocoapods-try (1.2.0)
4. 然后逐个删除:
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-core
Successfully uninstalled cocoapods-core-1.9.1
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.4
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.3.0
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.1.0
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-trunk
Successfully uninstalled cocoapods-trunk-1.4.1
shenyj@ShenYj-MBP ~ % sudo gem uninstall cocoapods-try
Successfully uninstalled cocoapods-try-1.2.0
网友评论