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 <[email protected]>, Michal Papis <[email protected]> [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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章