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