Cocoapods安装

转载自:www.jianshu.com/p/9e4e36ba8574

1、升级Ruby环境

终端输入:$gem update --system

2.更换ruby镜像地址

(1)查看当前镜像地址

终端输入:$ gem sources 或者 $ gem sources -l

终端输出:

*** CURRENT SOURCES ***

https://rubygems.org/

(2)移除当前镜像地址

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

输出;https://rubygems.org/ removed from sources

(3)添加国内最新镜像

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

输出:https://gems.ruby-china.org/ added to sources

3.安装CocoaPods

终端输入:$ sudo gem install cocoapods

终端输出:

Password:

Fetching: nanaimo-0.2.3.gem (100%)

Successfully installed nanaimo-0.2.3

Fetching: colored2-3.1.2.gem (100%)

Successfully installed colored2-3.1.2

Fetching: claide-1.0.1.gem (100%)

Successfully installed claide-1.0.1

Fetching: CFPropertyList-2.3.5.gem (100%)

Successfully installed CFPropertyList-2.3.5

Fetching: xcodeproj-1.4.4.gem (100%)

Successfully installed xcodeproj-1.4.4

Fetching: ruby-macho-1.1.0.gem (100%)

Successfully installed ruby-macho-1.1.0

Fetching: nap-1.1.0.gem (100%)

Successfully installed nap-1.1.0

Fetching: molinillo-0.5.7.gem (100%)

Successfully installed molinillo-0.5.7

Fetching: gh_inspector-1.0.3.gem (100%)

Successfully installed gh_inspector-1.0.3

Fetching: fourflusher-2.0.1.gem (100%)

Successfully installed fourflusher-2.0.1

Fetching: escape-0.0.4.gem (100%)

Successfully installed escape-0.0.4

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

Successfully installed cocoapods-try-1.1.0

Fetching: netrc-0.7.8.gem (100%)

Successfully installed netrc-0.7.8

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

Successfully installed cocoapods-trunk-1.2.0

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

Successfully installed cocoapods-stats-1.0.0

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

Successfully installed cocoapods-search-1.0.0

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

Successfully installed cocoapods-plugins-1.0.0

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

Successfully installed cocoapods-downloader-1.1.3

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

Successfully installed cocoapods-deintegrate-1.0.1

Fetching: fuzzy_match-2.0.4.gem (100%)

Successfully installed fuzzy_match-2.0.4

Fetching: thread_safe-0.3.6.gem (100%)

Successfully installed thread_safe-0.3.6

Fetching: tzinfo-1.2.3.gem (100%)

Successfully installed tzinfo-1.2.3

Fetching: i18n-0.8.1.gem (100%)

Successfully installed i18n-0.8.1

Fetching: activesupport-4.2.8.gem (100%)

Successfully installed activesupport-4.2.8

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

Successfully installed cocoapods-core-1.2.1

Fetching: cocoapods-1.2.1.gem (100%)

Successfully installed cocoapods-1.2.1

Parsing documentation for nanaimo-0.2.3

Installing ri documentation for nanaimo-0.2.3

Parsing documentation for colored2-3.1.2

Installing ri documentation for colored2-3.1.2

Parsing documentation for claide-1.0.1

Installing ri documentation for claide-1.0.1

Parsing documentation for CFPropertyList-2.3.5

Installing ri documentation for CFPropertyList-2.3.5

Parsing documentation for xcodeproj-1.4.4

Installing ri documentation for xcodeproj-1.4.4

Parsing documentation for ruby-macho-1.1.0

Installing ri documentation for ruby-macho-1.1.0

Parsing documentation for nap-1.1.0

Installing ri documentation for nap-1.1.0

Parsing documentation for molinillo-0.5.7

Installing ri documentation for molinillo-0.5.7

Parsing documentation for gh_inspector-1.0.3

Installing ri documentation for gh_inspector-1.0.3

Parsing documentation for fourflusher-2.0.1

Installing ri documentation for fourflusher-2.0.1

Parsing documentation for escape-0.0.4

Installing ri documentation for escape-0.0.4

Parsing documentation for cocoapods-try-1.1.0

Installing ri documentation for cocoapods-try-1.1.0

Parsing documentation for netrc-0.7.8

Installing ri documentation for netrc-0.7.8

Parsing documentation for cocoapods-trunk-1.2.0

Installing ri documentation for cocoapods-trunk-1.2.0

Parsing documentation for cocoapods-stats-1.0.0

Installing ri documentation for cocoapods-stats-1.0.0

Parsing documentation for cocoapods-search-1.0.0

Installing ri documentation for cocoapods-search-1.0.0

Parsing documentation for cocoapods-plugins-1.0.0

Installing ri documentation for cocoapods-plugins-1.0.0

Parsing documentation for cocoapods-downloader-1.1.3

Installing ri documentation for cocoapods-downloader-1.1.3

Parsing documentation for cocoapods-deintegrate-1.0.1

Installing ri documentation for cocoapods-deintegrate-1.0.1

Parsing documentation for fuzzy_match-2.0.4

Installing ri documentation for fuzzy_match-2.0.4

Parsing documentation for thread_safe-0.3.6

Installing ri documentation for thread_safe-0.3.6

Parsing documentation for tzinfo-1.2.3

Installing ri documentation for tzinfo-1.2.3

Parsing documentation for i18n-0.8.1

Installing ri documentation for i18n-0.8.1

Parsing documentation for activesupport-4.2.8

Installing ri documentation for activesupport-4.2.8

Parsing documentation for cocoapods-core-1.2.1

Installing ri documentation for cocoapods-core-1.2.1

Parsing documentation for cocoapods-1.2.1

Installing ri documentation for cocoapods-1.2.1

Done installing documentation for nanaimo, colored2, claide, CFPropertyList, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-stats, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, fuzzy_match, thread_safe, tzinfo, i18n, activesupport, cocoapods-core, cocoapods after 18 seconds

26 gems installed

终端输入:$ pod setup

终端输出:Setting up CocoaPods master repo

$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...

remote: Counting objects: 1257069, done.

remote: Compressing objects: 100% (1007/1007), done.

remote: Total 1257069 (delta 443), reused 35 (delta 35), pack-reused 1255971

Receiving objects: 100% (1257069/1257069), 396.95 MiB | 157.00 KiB/s, done.

Resolving deltas: 100% (616031/616031), done.

Checking out files: 100% (154757/154757), done.

Setup completed

4.搜索第三方库

终端输入:$ pod search AFNetworking

终端输出:

你可能感兴趣的:(Cocoapods安装)