美文网首页
Cocoapods安装过程以及遇到的问题

Cocoapods安装过程以及遇到的问题

作者: 石弓山长 | 来源:发表于2019-05-12 09:35 被阅读0次

准备工作:

首先移除现有的Ruby镜像

终端输入:$gem sources --remove https://rubygems.org/

然后添加国内最新镜像源(淘宝的Ruby镜像已经不更新了)

终端输入:$gem sources -a https://gems.ruby-china.org/

执行完毕之后输入gem sources -l来查看当前镜像

终端输入:$gem sources -l

如果结果是 *** CURRENT SOURCES ***https://gems.ruby-china.org/说明添加成功,否则继续执行$gem source -a https://gems.ruby-china.org/来添加。

开始安装:

sudo gem install cocoapods

安装pods报错1:Error fetching https://gems.ruby-china.org/:

更换ruby镜像报错换成下面的:

http://gems.ruby-china.com/

安装pods报错2:ERROR: While executing gem ... (Gem::DependencyError)

更新gem包:

sudo gem update --system

安装报错3:ERROR: While executing gem ... (Gem::FilePermissionError)

没有文件写入权限,安装命令前加 sudo 或者用下面的命令

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

到这里大部分都成功了

执行pod setup,开始等待,现在你可以听听音乐,看看电影.......

经过漫长等待终于完成

相关文章

网友评论

      本文标题:Cocoapods安装过程以及遇到的问题

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