CocoaPods安装

在安装CocoaPods之前,首先要在本地安装好Ruby环境。至于如何在Mac中安装好Ruby环境,请参考:。

安装CocoaPods十分简单,只需要一行命令。

在Terminator(也就是终端)中输入以下命令(需要输入密码)

sudo gem install cocoapods

但很遗憾,报错了,原因是被墙了

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNRESET: Connection reset by peer - connect(2) (https://api.rubygems.org/quick/Marshal.4.8/cocoapods-0.38.2.gemspec.rz)

这里通过Taobao进行镜像

bogon:~ Jerry$ gem sources --remove https://rubygems.org/   ##移除当前网站节点配置
https://rubygems.org/ removed from sources
bogon:~ Jerry$ gem sources -a http://ruby.taobao.org/    ##用淘宝的Ruby镜像来访问
http://ruby.taobao.org/ added to sources
bogon:~ Jerry$ gem sources -l      ##验证你的Ruby镜像是并且仅是taobao,可以用以下命令查看
*** CURRENT SOURCES ***

http://ruby.taobao.org/
bogon:~ Jerry$ 

再输入安装命令,就安装好了

bogon:~ Jerry$ sudo gem install cocoapods

Password:

Fetching: nap-0.8.0.gem (100%)

Successfully installed nap-0.8.0

Fetching: thread_safe-0.3.5.gem (100%)

Successfully installed thread_safe-0.3.5

Fetching: minitest-5.8.1.gem (100%)

Successfully installed minitest-5.8.1

Fetching: tzinfo-1.2.2.gem (100%)

Successfully installed tzinfo-1.2.2

Fetching: i18n-0.7.0.gem (100%)

...

 

posted @ 2015-10-02 16:11  张永存(Jerry)  阅读(233)  评论(0编辑  收藏  举报