Cocodpods的详细安装教程
CocoaPods最新安装教程
cocoaPods 使用Ruby实现,Mac自带Ruby源为https://rubygems.org/(需要翻墙),之前可以换成淘宝镜像https://rubygems.org/,但淘宝镜像已无法使用,现在可以换为https://gems.ruby-china.org/
查看当前镜像源命令:gem source -l
1.替换镜像源命令:
gem sources -r https://rubygems.org/ (移除旧镜像) gem sources -a https://gems.ruby-china.org/ (添加新镜像) 执行完替换工作后查看当前镜像是否替换成功
2.安装cocoaPods命令:
sudo gem install cocoapods ⚠️如果出现以下情况

解决办法:sudo gem install -n /usr/local/bin cocoapods 安装成功见图2.2

3.vim podfile创建文件并添加需要的第三方库见图3:

4.pod install
cocoapods 会帮我们完成下载三方库、配置依赖关系、导入依赖Framework的工作。安装成功见图4:

⚠️ 若安装失败请参考安装教程:http://blog.csdn.net/hong1595/article/details/74010620
小结: https://gems.ruby-china.org/ 替换成此镜像有一个明显的问题=》下载过慢, 解决方案 https://www.cnblogs.com/wntd/p/7348943.html
😘😘😘如果觉得对您有帮助,麻烦请点个❤️哦