在桌面前往 /etc/hosts
把host文件拷贝出来 ,在https://www.ipaddress.com/ 中获得 raw.githubusercontent.com 的 IP地址。接下来把以下搜索到的IP地址放到host文件里面,然后替换掉原来的
185.199.108.133raw.githubusercontent.com
185.199.109.133raw.githubusercontent.com
185.199.110.133raw.githubusercontent.com
185.199.111.133raw.githubusercontent.com
安装rvm
curl -sSL https://get.rvm.io | bash -s stable
rvm install 3.0.0
rvm docs generate-ri
rvm use ruby-3.0.0 --default
更换gem 源
gem sources -l
gem sources --removehttps://rubygems.org
gem sources -ahttps://gems.ruby-china.com
安装ruby国内源
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
ruby -v
sudo gem update --system
sudo gem update --system -n /usr/local/bin
sudo gem install -n /usr/local/bin cocoapods
pod --version
获取权限
sudo chmod +rx /usr/local/bin/
这是国内的镜像地址,不需要梯子,速度刚刚的
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git ~/.cocoapods/repos/trunk
pod search AFNetworking
能搜索出来即可