cocoapods安装以及解决update\install慢问题

1.安装主要看唐巧这一篇文章

2.解决update/install超慢的问题看着一篇文章

在使用过程中遇到的一些问题:

1.在执行pod install命令时, 提示本机coocopods版本老旧:

bogon:ADPhotoBrowser LittleP$ pod install
Updating local specs repositories
[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.

[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

如何解决:
第一步, 当然是cocoapods进行版本更新sudo gem install cocoapods, 遇到新问题:

bogon:ADPhotoBrowser LittleP$ sudo gem install cocoapods
Password:***
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.5.0), cocoapods-deintegrate (< 2.0, >= 1.0.2), cocoapods-downloader (< 2.0, >= 1.2.0), molinillo (~> 0.6.5), xcodeproj (< 2.0, >= 1.5.7)

解决办法是把本地gem更新到最新版本sudo gem update --system
更新完成后继续执行sudo gem install cocoapods

bogon:ADPhotoBrowser LittleP$ sudo gem install cocoapods
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: cocoapods-core-1.5.0.gem (100%)
Successfully installed cocoapods-core-1.5.0
Fetching: claide-1.0.2.gem (100%)
Successfully installed claide-1.0.2
Fetching: cocoapods-deintegrate-1.0.2.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.2
Fetching: cocoapods-downloader-1.2.0.gem (100%)
Successfully installed cocoapods-downloader-1.2.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.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: cocoapods-trunk-1.3.0.gem (100%)
Successfully installed cocoapods-trunk-1.3.0
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: molinillo-0.6.5.gem (100%)
Successfully installed molinillo-0.6.5
Fetching: atomos-0.1.2.gem (100%)
Successfully installed atomos-0.1.2
Fetching: CFPropertyList-3.0.0.gem (100%)
Successfully installed CFPropertyList-3.0.0
Fetching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: nanaimo-0.2.5.gem (100%)
Successfully installed nanaimo-0.2.5
Fetching: xcodeproj-1.5.7.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

遇到新的问题

ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

更改gem cocoapods更新命令为sudo gem install -n /usr/local/bin cocoapods后:

bogon:ADPhotoBrowser LittleP$ sudo gem install -n /usr/local/bin cocoapods
Password:
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Successfully installed xcodeproj-1.5.7
Fetching: fourflusher-2.0.1.gem (100%)
Successfully installed fourflusher-2.0.1
Fetching: gh_inspector-1.1.3.gem (100%)
Successfully installed gh_inspector-1.1.3
Fetching: ruby-macho-1.1.0.gem (100%)
Successfully installed ruby-macho-1.1.0
Fetching: cocoapods-1.5.0.gem (100%)
Successfully installed cocoapods-1.5.0
Parsing documentation for xcodeproj-1.5.7
Installing ri documentation for xcodeproj-1.5.7
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for ruby-macho-1.1.0
Installing ri documentation for ruby-macho-1.1.0
Parsing documentation for cocoapods-1.5.0
Installing ri documentation for cocoapods-1.5.0
5 gems installed

至此, cocoapods更新完成~

gem常用命令:

更新gem:

sudo gem update --system

删除gem镜像源:

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

更改gem镜像源:

gem sources -a https://ruby.taobao.org/

查看本地gem镜像源:

gem sources -l

cocoapods常用命令:

移除pod下载源:

pod repo remove master

更改pod下载源:

pod repo add master https://gitcafe.com/akuandev/Specs.git

更新下载源:

pod repo update

解除项目cocopods依赖

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

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,532评论 25 708
  • 无论是小礼服还是晚礼服,只要跟这个“礼”沾边,价格都不便宜,所以自然心疼爱惜,要好好保护起来。 慵懒收纳术第三十九...
    收了纳个Queen阅读 2,046评论 0 2
  • 收不完的文,做不完的帐,终于成功让我得了咽喉炎。 忙的忙,闲的闲,笑的不一定是快乐的,沉默的不一定是无言的,位高权...
    松鼠的核桃仁阅读 178评论 1 0
  • 看啊我也有工作 我也有奋斗的目标 如果没有遇见你 我是多么颓废的人 我总以为忙起来就能不想你 是我无能还是你太厉害
    小嗦嗨阅读 195评论 0 0
  • 我一个最大的缺点就是不知道反省,失败是成功之母,但是对于不懂得反省的人,失败是必然
    下笔如神阅读 133评论 0 0