博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CocoaPods安装使用及配置私有库
阅读量:6716 次
发布时间:2019-06-25

本文共 4939 字,大约阅读时间需要 16 分钟。

hot3.png

1.安装ruby环境,添加淘宝ruby镜像

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

//等有反应之后再敲入以下命令
$ gem sources -a http://ruby.taobao.org/

Error fetching http://ruby.taobao.org/:

bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)

原因:淘宝停止基于 HTTP 协议的镜像服务 需要改用https的协议

修改为如何https 即可 $ gem sources -a https://ruby.taobao.org/

2.查看是否设置成功:

$ gem sources -l

3.然后安装cocoapods:

$ sudo gem install cocoapods

Password:

Fetching: i18n-0.7.0.gem (100%)

Successfully installed i18n-0.7.0

Fetching: thread_safe-0.3.5.gem (100%)

Successfully installed thread_safe-0.3.5

Fetching: tzinfo-1.2.2.gem (100%)

Successfully installed tzinfo-1.2.2

Fetching: minitest-5.9.0.gem (100%)

Successfully installed minitest-5.9.0

Fetching: activesupport-4.2.6.gem (100%)

Successfully installed activesupport-4.2.6

Fetching: nap-1.1.0.gem (100%)

Successfully installed nap-1.1.0

Fetching: fuzzy_match-2.0.4.gem (100%)

Successfully installed fuzzy_match-2.0.4

Fetching: cocoapods-core-1.0.1.gem (100%)

Successfully installed cocoapods-core-1.0.1

Fetching: claide-1.0.0.gem (100%)

Successfully installed claide-1.0.0

Fetching: cocoapods-deintegrate-1.0.0.gem (100%)

Successfully installed cocoapods-deintegrate-1.0.0

Fetching: cocoapods-downloader-1.0.0.gem (100%)

Successfully installed cocoapods-downloader-1.0.0

Fetching: cocoapods-plugins-1.0.0.gem (100%)

Successfully installed cocoapods-plugins-1.0.0

Fetching: cocoapods-search-1.0.0.gem (100%)

Successfully installed cocoapods-search-1.0.0

Fetching: cocoapods-stats-1.0.0.gem (100%)

Successfully installed cocoapods-stats-1.0.0

Fetching: netrc-0.7.8.gem (100%)

Successfully installed netrc-0.7.8

Fetching: cocoapods-trunk-1.0.0.gem (100%)

Successfully installed cocoapods-trunk-1.0.0

Fetching: cocoapods-try-1.0.0.gem (100%)

Successfully installed cocoapods-try-1.0.0

Fetching: molinillo-0.4.5.gem (100%)

Successfully installed molinillo-0.4.5

Fetching: colored-1.2.gem (100%)

Successfully installed colored-1.2

Fetching: xcodeproj-1.1.0.gem (100%)

Successfully installed xcodeproj-1.1.0

Fetching: escape-0.0.4.gem (100%)

Successfully installed escape-0.0.4

Fetching: fourflusher-0.3.2.gem (100%)

Successfully installed fourflusher-0.3.2

Fetching: cocoapods-1.0.1.gem (100%)

Successfully installed cocoapods-1.0.1

Parsing documentation for i18n-0.7.0

Installing ri documentation for i18n-0.7.0

Parsing documentation for thread_safe-0.3.5

Installing ri documentation for thread_safe-0.3.5

Parsing documentation for tzinfo-1.2.2

Installing ri documentation for tzinfo-1.2.2

Parsing documentation for minitest-5.9.0

Installing ri documentation for minitest-5.9.0

Parsing documentation for activesupport-4.2.6

unable to convert "\x84" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping

Installing ri documentation for activesupport-4.2.6

Parsing documentation for nap-1.1.0

Installing ri documentation for nap-1.1.0

Parsing documentation for fuzzy_match-2.0.4

Installing ri documentation for fuzzy_match-2.0.4

Parsing documentation for cocoapods-core-1.0.1

Installing ri documentation for cocoapods-core-1.0.1

Parsing documentation for claide-1.0.0

Installing ri documentation for claide-1.0.0

Parsing documentation for cocoapods-deintegrate-1.0.0

Installing ri documentation for cocoapods-deintegrate-1.0.0

Parsing documentation for cocoapods-downloader-1.0.0

Installing ri documentation for cocoapods-downloader-1.0.0

Parsing documentation for cocoapods-plugins-1.0.0

Installing ri documentation for cocoapods-plugins-1.0.0

Parsing documentation for cocoapods-search-1.0.0

Installing ri documentation for cocoapods-search-1.0.0

Parsing documentation for cocoapods-stats-1.0.0

Installing ri documentation for cocoapods-stats-1.0.0

Parsing documentation for netrc-0.7.8

Installing ri documentation for netrc-0.7.8

Parsing documentation for cocoapods-trunk-1.0.0

Installing ri documentation for cocoapods-trunk-1.0.0

Parsing documentation for cocoapods-try-1.0.0

Installing ri documentation for cocoapods-try-1.0.0

Parsing documentation for molinillo-0.4.5

Installing ri documentation for molinillo-0.4.5

Parsing documentation for colored-1.2

Installing ri documentation for colored-1.2

Parsing documentation for xcodeproj-1.1.0

Installing ri documentation for xcodeproj-1.1.0

Parsing documentation for escape-0.0.4

Installing ri documentation for escape-0.0.4

Parsing documentation for fourflusher-0.3.2

Installing ri documentation for fourflusher-0.3.2

Parsing documentation for cocoapods-1.0.1

Installing ri documentation for cocoapods-1.0.1

23 gems installed

 

4.查看cocoapods是否支持某个类库

$ pod search 类库名,支持模糊查询(如:AFNetworking)

看到这里,你心里会不会说,我靠!太爽了,这么容易就可以下载并且安装好了!是的,小编也是这么想的。CocoPods就是这么简单,使用也十分简单。继续往下看吧。

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

执行pod install 命令

出现Setting up CocoaPods master repo,说明Cocoapods在将它的信息下载到 ~/.cocoapods里;

cd  到该目录里,用du -sh *命令来查看文件大小,每隔几分钟查看一次,这个目录最终大小是778多M,就是完成了

转载于:https://my.oschina.net/u/615517/blog/693720

你可能感兴趣的文章
RocketMQ调研笔记
查看>>
maven 注册 jar
查看>>
高并发写入mysql的设计
查看>>
成长点滴:我不知道该说些什么?
查看>>
linux之使用man查看命令手册
查看>>
IT管理员如何保证你的内网安全?
查看>>
用U盘安装debian系统
查看>>
Mac 下得Jmeter 测试
查看>>
java基础之本地线程
查看>>
sqlserver2005 递归查询
查看>>
30天提升技术人的写作力-第十一天
查看>>
OSPF环境下帧中继的配置
查看>>
Python 17.4 使用Web框架
查看>>
马哥1-3
查看>>
spring容器
查看>>
Linux系统架构(LB-HA集群)-nginx负载均衡集群配置
查看>>
ios版塔防类游戏源码
查看>>
Backup Exec 2010 V-79-57344-65072
查看>>
我的友情链接
查看>>
SequoiaDB 笔记
查看>>