一、
1 添加taobao提供的镜像地址:http://ruby.taobao.org/
移除命令:gem sources --remove https://rubygems.org/
添加命令:gem sources -a http://ruby.taobao.org/
查看gem来源列表:$ gem sources -l
2 在命令终端输入:
sudo gem install cocoapods
等待15分钟:
$ sudo gem install cocoapods
Password:
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.4.gem (100%)
Successfully installed thread_safe-0.3.4
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.5.1.gem (100%)
Successfully installed minitest-5.5.1
Fetching: activesupport-4.2.0.gem (100%)
Successfully installed activesupport-4.2.0
Fetching: nap-0.8.0.gem (100%)
Successfully installed nap-0.8.0
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: cocoapods-core-0.36.0.gem (100%)
Successfully installed cocoapods-core-0.36.0
Fetching: claide-0.8.1.gem (100%)
Successfully installed claide-0.8.1
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: xcodeproj-0.23.0.gem (100%)
Successfully installed xcodeproj-0.23.0
Fetching: cocoapods-downloader-0.8.1.gem (100%)
Successfully installed cocoapods-downloader-0.8.1
Fetching: cocoapods-plugins-0.4.1.gem (100%)
Successfully installed cocoapods-plugins-0.4.1
Fetching: cocoapods-try-0.4.3.gem (100%)
Successfully installed cocoapods-try-0.4.3
Fetching: netrc-0.7.8.gem (100%)
Successfully installed netrc-0.7.8
Fetching: cocoapods-trunk-0.6.0.gem (100%)
Successfully installed cocoapods-trunk-0.6.0
Fetching: molinillo-0.2.1.gem (100%)
Successfully installed molinillo-0.2.1
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: cocoapods-0.36.0.gem (100%)
Successfully installed cocoapods-0.36.0
Parsing documentation for i18n-0.7.0
Installing ri documentation for i18n-0.7.0
Parsing documentation for thread_safe-0.3.4
Installing ri documentation for thread_safe-0.3.4
Parsing documentation for tzinfo-1.2.2
Installing ri documentation for tzinfo-1.2.2
Parsing documentation for minitest-5.5.1
Installing ri documentation for minitest-5.5.1
Parsing documentation for activesupport-4.2.0
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.0
Parsing documentation for nap-0.8.0
Installing ri documentation for nap-0.8.0
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for cocoapods-core-0.36.0
Installing ri documentation for cocoapods-core-0.36.0
Parsing documentation for claide-0.8.1
Installing ri documentation for claide-0.8.1
Parsing documentation for colored-1.2
Installing ri documentation for colored-1.2
Parsing documentation for xcodeproj-0.23.0
Installing ri documentation for xcodeproj-0.23.0
Parsing documentation for cocoapods-downloader-0.8.1
Installing ri documentation for cocoapods-downloader-0.8.1
Parsing documentation for cocoapods-plugins-0.4.1
Installing ri documentation for cocoapods-plugins-0.4.1
Parsing documentation for cocoapods-try-0.4.3
Installing ri documentation for cocoapods-try-0.4.3
Parsing documentation for netrc-0.7.8
Installing ri documentation for netrc-0.7.8
Parsing documentation for cocoapods-trunk-0.6.0
Installing ri documentation for cocoapods-trunk-0.6.0
Parsing documentation for molinillo-0.2.1
Installing ri documentation for molinillo-0.2.1
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for cocoapods-0.36.0
Installing ri documentation for cocoapods-0.36.0
20 gems installed
二、为了和谐,为了速度,我们身在天朝,你懂的,使用cocoapods国内镜像服务器:
pod repo remove master
pod repo add master https://gitcafe.com/akuandev/Specs.git
pod repo update
第二条命令运行比较耗时,因为要clone,5、6分钟可能要,因为它要把自己
大概60M的specs库拷贝下来
,上面的地址不行,可以更换下面几个镜像
1:http://akinliu.github.io/2014/05/03/cocoapods-specs-/
2:http://git.oschina.net/akuandev/Specs.git
这些镜像都是一位大大贡献出来的,链接在此:http://akinliu.github.io/2014/05/03/cocoapods-specs-/
使用参数忽略掉specs更新,直接更新我们想要的库:
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update
不用担心我们的
specs会很老,因为该镜像的大大,每隔10分钟就帮我们同步了一次specs,童鞋们要感谢他。