安装cocoapods的两种方式

方式一:

gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
gem sources -l
sudo gem install -n /usr/local/bin cocoapods //此命令既可以安装,也可以升级

方式二:

brew install cocoapods // 用此命令安装后,要去.zshrc中增加环境变量

安装之后,可以将仓库镜像替换为清华镜像:

pod repo remove master
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod repo update

发表评论