正常cocoapods更新版本的命令

sudo gem install cocoapods

但是呢,经常都会遇到权限不足的情况,所以改成下面的命令

sudo gem install -n /usr/local/bin cocoapods

还有如果你想指定安装cocoapods 版本号,只需要在命令的最后面 加上对应的版本号就可以了

sudo gem install -n /usr/local/bin cocoapods -v 1.8.3

会安装当然需要会卸载,卸载的方法如下

1.卸载老版本cocopods

$ sudo gem uninstall cocoapods

2.查看本地安装过的cocopods相关东西

$ gem list --local | grep cocoapods

显示如下:


cocoapods (1.0.1)

cocoapods-core (1.0.1)

cocoapods-deintegrate (1.0.1)

cocoapods-downloader (1.1.1)

cocoapods-plugins (1.0.0)

cocoapods-search (1.0.0)

cocoapods-stats (1.0.0)

cocoapods-trunk (1.0.0)

cocoapods-try (1.1.0)

然后使用命令逐个删除

$ sudo gem uninstall cocoapods-core

$ sudo gem uninstall cocoapods-deintegrate

如果怕删不干净有残留的话可以找到 .cocopods 文件(隐藏文件)删掉就好