CocoaPots 安装教程


CocoaPots 安装教程

一、注意事项:安装CocoaPots的顺序:
Xcode->homebrew->RVM->Ruby->CocoaPats;

网上很多教程都忽略了homebrew,然而这一步非常重要!

二、安装步骤:
1.安装Xcode(略)
2.安装homebrew
进入官网http://brew.sh/index_zh-cn.html你会发现官网页面中央位置有一段命令,将其复制到命令行中运行就OK


3.安装RVM (homebrew的作用就是执行下面这条指令的时候自动为RVM安装依赖包)
$ curl -L https://get.rvm.io | bash -s stable

检查一下RVM是否已经正确安装
$  rvm -v
   rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

4.安装Ruby(如果安装错误请移步看我另一篇博客)
$ rvm install 2.0.0

安装效果

LuohandeMacBook-Pro:~ LuohanCC$ rvm install 2.0.0

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.10/x86_64/ruby-2.0.0-p643.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for osx.

Installing requirements for osx.

Updating system.....

Installing required packages: libyaml, libksba, openssl.......

Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.

Requirements installation successful.

Installing Ruby from source to: /Users/LuohanCC/.rvm/rubies/ruby-2.0.0-p643, this may take a while depending on your cpu(s)...

ruby-2.0.0-p643 - #downloading ruby-2.0.0-p643, this may take a while depending on your connection...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 10.2M  100 10.2M    0     0  14065      0  0:12:45  0:12:45 --:--:-- 14498›

ruby-2.0.0-p643 - #extracting ruby-2.0.0-p643 to /Users/LuohanCC/.rvm/src/ruby-2.0.0-p643....

ruby-2.0.0-p643 - #configuring.................................................

ruby-2.0.0-p643 - #post-configuration.

ruby-2.0.0-p643 - #compiling.................................................................................-

ruby-2.0.0-p643 - #installing..............

ruby-2.0.0-p643 - #making binaries executable..

ruby-2.0.0-p643 - #downloading rubygems-2.4.8

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  437k  100  437k    0     0  45532      0  0:00:09  0:00:09 --:--:-- 47175

No checksum for downloaded archive, recording checksum in user configuration.

ruby-2.0.0-p643 - #extracting rubygems-2.4.8....

ruby-2.0.0-p643 - #removing old rubygems.........

ruby-2.0.0-p643 - #installing rubygems-2.4.8......................

ruby-2.0.0-p643 - #gemset created /Users/LuohanCC/.rvm/gems/ruby-2.0.0-p643@global

ruby-2.0.0-p643 - #importing gemset /Users/LuohanCC/.rvm/gemsets/global.gems.................................-

ruby-2.0.0-p643 - #generating global wrappers........

ruby-2.0.0-p643 - #gemset created /Users/LuohanCC/.rvm/gems/ruby-2.0.0-p643

ruby-2.0.0-p643 - #importing gemsetfile /Users/LuohanCC/.rvm/gemsets/default.gems evaluated to empty gem list

ruby-2.0.0-p643 - #generating default wrappers........

ruby-2.0.0-p643 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).

Install of ruby-2.0.0-p643 - #complete 

Ruby was built without documentation, to build it run: rvm docs generate-ri


安装Ruby完成以后设置默认Ruby版本,也就是刚才我们下载的那个版本
$ rvm 2.0.0 --default

5.接下来利用已经配置好的Ruby环境来安装CocoaPods
$ sudo gem install cocoapods

如果cocoapods.org被墙了访问不了或是一直卡着不动,我们可以使用taobao的Ruby镜像
$ gem sources --remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/

验证Ruby镜像是否成功
$ gem sources -l

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值