首先先删除掉之前的历史版本,执行下面命令:
sudo gem uninstall -n /usr/local/bin cocoapods cocoapods-core cocoapods-deintegrate cocoapods-downloader cocoapods-plugins cocoapods-search cocoapods-stats cocoapods-trunk cocoapods-try
安装指定版本,使用下面命令
sudo gem install -n /usr/local/bin cocoapods -v 版本号
举例:
sudo gem install -n /usr/local/bin cocoapods -v 1.13.0