1.安装rvm
curl -L get.rvm.io | bash -s stable
source ~/.bashrc
source ~/.bash_profile
2.安装Homebrew(速度很快,国内镜像源)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
3.安装ruby
rvm install 3.0.0
4.更换源
sudo gem update --system
gem sources -l // 查看源
gem sources --add https://gems.ruby-china.com/
gem sources --remove https://rubygems.org/ //删除
5.安装CocoaPods
sudo gem install -n /usr/local/bin cocoapods
6.安装本地库(国内镜像速度快)
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git ~/.cocoapods/repos/trunk
7.pod 检查
pod search AFNetworking
参考文章
https://www.jianshu.com/p/08e5f06dd31d
https://zhuanlan.zhihu.com/p/372576355