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%)
...
Blog都是随笔,只当做笔记,不会有详细介绍,测试请慎重。。。