1.卸载原有cocoapods
rm -fr ~/.cocoapods/
2.查询Ruby源地址
gem source -l
3.安装homebrew (时间略久,等就完事儿)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4.安装rvm
curl -L get.rvm.io | bash -s stable
source ~/.bashrc
source ~/.bash_profile
5.安装ruby
rvm install 3.0.0
6.设置成默认版本
rvm use 3.0.0 --default
7.安装cocoapods
sudo gem install -n /usr/local/bin cocoapods
image.png
pod setup
finish
遇到 command not found: pod
直接卸载重装
网友评论