CocoaPods安裝使用及配置私有庫

1.安裝ruby環境,添加淘寶ruby鏡像xcode

$ gem sources --remove https://rubygems.org/
//等有反應以後再敲入如下命令
$ gem sources -a http://ruby.taobao.org/
ruby

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

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

緣由:淘寶中止基於 HTTP 協議的鏡像服務 須要改用https的協議code

修改成如何https 便可 $ gem sources -a https://ruby.taobao.org/ip

2.查看是否設置成功:unicode

$ gem sources -lrem

3.而後安裝cocoapods:it

$ sudo gem install cocoapodsio

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,就是完成了

相關文章
相關標籤/搜索