iOS Cocoapods的简单安装使用

一、查看是否有已安装的镜像源

命令:gem sources -l

输出:

*** CURRENT SOURCES ***

https://gems.ruby-china.org/

二、将不可用的源 https://gems.ruby-china.org/ 换成 https://gems.ruby-china.com/

1)移除 https://gems.ruby-china.org/

命令:gem sources --remove https://gems.ruby-china.org/

2)换成 https://gems.ruby-china.com/

命令:gem sources -a https://gems.ruby-china.com/

输出:https://gems.ruby-china.com/ added to sources

三、安装cocoapods

安装之前先更新一下:

命令:sudo gem update--system

命令:sudo gem install -n /usr/local/bin cocoapods

以上已完成安装。

------------------------------------------------------------------------------------

若要修改源提速(以清华的镜像为例):

cd ~/.cocoapods/repos

pod repo remove master

git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master

最后在podfile文件第一行添加:

source ‘https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git’

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容