美文网首页
iOS Cocoapods的简单安装使用

iOS Cocoapods的简单安装使用

作者: vihong丶 | 来源:发表于2020-03-24 01:02 被阅读0次

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

命令: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’

相关文章

网友评论

      本文标题:iOS Cocoapods的简单安装使用

      本文链接:https://www.haomeiwen.com/subject/cqdnyhtx.html