2022年Mac安装Cocoapods

一.查看Ruby镜像,如果不是“https://gems.ruby-china.com/”请更换镜像

gem sources -l

移除现有的Ruby镜像

gem sources --remove https://rubygems.org/

更换Ruby镜像

gem sources --add https://gems.ruby-china.com/

二.安装cocoapod

sudo gem install -n /usr/local/bin cocoapods

查看pod版本

pod --version

三.安装pod本地库

git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git ~/.cocoapods/repos/trunk

常见问题:

问题一:

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/all_pods_versions_a_7_5.txt Response: Timeout was reached

pod cache clean --all
pod setup

你可能感兴趣的:(2022年Mac安装Cocoapods)