CocoaPods安裝教程

1.CocoaPods的安裝铅祸,首先要安裝好Ruby揉阎。

2.Ruby的安裝

2.1在終端輸入(要等一段時(shí)間)

curl-L https://get.rvm.io | bash -s stable

然后輸入

source~/.rvm/scripts/rvm

輸入(檢查版本)

rvm-v

如何有返回

rvm1.29.3(latest)byMichalPapis,PiotrKuczynski,WayneE.Seguin[https://rvm.io]

說明安裝RVM成功

輸入(更新RVM)

rvmgetstable

3.安裝Ruby

在終端輸入?rvm list known?杏节,列出所有可安裝的版本

# MRI Rubies[ruby-]1.8.6[-p420][ruby-]1.8.7[-head] # security released on head[ruby-]1.9.1[-p431][ruby-]1.9.2[-p330][ruby-]1.9.3[-p551][ruby-]2.0.0[-p648][ruby-]2.1[.10][ruby-]2.2[.7][ruby-]2.3[.4][ruby-]2.4[.1]ruby-head# for forks use: rvm install ruby-head- --url https://github.com/github/ruby.git --branch2.2# JRubyjruby-1.6[.8]jruby-1.7[.27]jruby[-9.1.13.0]jruby-head# Rubiniusrbx-1[.4.3]rbx-2.3[.0]rbx-2.4[.1]rbx-2[.5.8]rbx-3[.84]rbx-head# Opalopal# Minimalistic ruby implementation - ISO30170:2012mruby-1.0.0mruby-1.1.0mruby-1.2.0mruby-1[.3.0]mruby[-head]# Ruby Enterprise Editionree-1.8.6ree[-1.8.7][-2012.02]# Topaztopaz# MagLevmaglev[-head]maglev-1.0.0# Mac OS X Snow Leopard Or Newermacruby-0.10macruby-0.11macruby[-0.12]macruby-nightlymacruby-head# IronRubyironruby[-1.1.3]ironruby-headLvXinJiMac:~ lvxinji$

3.2 挑一個(gè)安裝

終端輸入?rvm install 2.4.0

如果報(bào)錯(cuò):


則需要先在終端輸入 :rvm autolibs disable 再輸入?rvm install 2.4.0 就沒事了谤民,沒有報(bào)錯(cuò)就忽略這個(gè)慎框。

安裝成功

Searchingforbinary rubies, this might take some time.No binary rubies availablefor:osx/10.13/x86_64/ruby-2.4.0.Continuing with compilation. Please read'rvm help mount'to get more information on binary rubies.Installing Ruby from sourceto:/Users/lvxinji/.rvm/rubies/ruby-2.4.0, this may take awhiledepending on your cpu(s)...ruby-2.4.0-#downloading ruby-2.4.0, this may take a while depending on your connection...% Total? ? % Received % Xferd? Average Speed? Time? ? Time? ? Time? Current? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Dload? Upload? Total? Spent? ? Left? Speed10011.9M10011.9M001701k00:00:070:00:07--:--:--1753kruby-2.4.0-#extracting ruby-2.4.0to /Users/lvxinji/.rvm/src/ruby-2.4.0....ruby-2.4.0-#applying patch /Users/lvxinji/.rvm/patches/ruby/2.4.0/ruby_2_4_gcc7.patch.ruby-2.4.0-#applying patch /Users/lvxinji/.rvm/patches/ruby/2.4.0/random_c_using_NR_prefix.patch.ruby-2.4.0-#configuring..........................................................-ruby-2.4.0-#post-configuration.ruby-2.4.0-#compiling.............................................................ruby-2.4.0-#installing.......ruby-2.4.0-#making binaries executable..ruby-2.4.0-#downloading rubygems-2.6.14% Total? ? % Received % Xferd? Average Speed? Time? ? Time? ? Time? Current? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Dload? Upload? Total? Spent? ? Left? Speed100751k100751k001975500:00:380:00:38--:--:--47500No checksumfordownloaded archive, recording checksuminuser configuration.ruby-2.4.0-#extracting rubygems-2.6.14....ruby-2.4.0-#removing old rubygems.........ruby-2.4.0-#installing rubygems-2.6.14...........................ruby-2.4.0-#gemset created /Users/lvxinji/.rvm/gems/ruby-2.4.0@globalruby-2.4.0-#importing gemset /Users/lvxinji/.rvm/gemsets/global.gems.............there was an error installing gem rubygems-bundler.....................ruby-2.4.0-#generating global wrappers........ruby-2.4.0-#gemset created /Users/lvxinji/.rvm/gems/ruby-2.4.0ruby-2.4.0-#importing gemsetfile /Users/lvxinji/.rvm/gemsets/default.gems evaluated to empty gem listruby-2.4.0-#generating default wrappers........ruby-2.4.0-#adjusting #shebangs for (gem irb erb ri rdoc testrb rake).Install of ruby-2.4.0-#completePlease be aware that you just installed a ruby that requires2patches just to be compiled on an up to date linux system.This may have knownandunaccountedforsecurity vulnerabilities.Please consider upgrading to ruby-2.4.1which will have all of the latest security patches.Ruby was built without documentation, to build itrun:rvm docs generate-ri

設(shè)置默認(rèn)版本 ?rvm use 2.4.0 --default

到這里Ruby環(huán)境安裝就結(jié)束了。

4.安裝CocoaPods

本來是直接在終端敲入以下代碼就可以徒像,因?yàn)橛袎κ蛱兀孕枰褂锰詫氱R像。

sudogem install cocoapods

在終端輸入

gem sources --removehttps://rubygems.org/

接著輸入

gem sources -ahttps://ruby.taobao.org/

如果報(bào)錯(cuò):


則換另一種方法:

在終端輸入:$gem source -a http://rubygems.org/ to read

會跳出什么DO YOU Want.... 輸入y锯蛀。

然后?輸入gem source -a http://rubygems.org/ to read

輸入開機(jī)密碼灭衷,就成功了。

Fetching:concurrent-ruby-1.0.5.gem(100%)Successfullyinstalledconcurrent-ruby-1.0.5Fetching:i18n-0.9.0.gem(100%)Successfullyinstalledi18n-0.9.0Fetching:thread_safe-0.3.6.gem(100%)Successfullyinstalledthread_safe-0.3.6Fetching:tzinfo-1.2.3.gem(100%)Successfullyinstalledtzinfo-1.2.3Fetching:activesupport-4.2.10.gem(100%)Successfullyinstalledactivesupport-4.2.10Fetching:nap-1.1.0.gem(100%)Successfullyinstallednap-1.1.0Fetching:fuzzy_match-2.0.4.gem(100%)Successfullyinstalledfuzzy_match-2.0.4Fetching:cocoapods-core-1.4.0.beta.1.gem(100%)Successfullyinstalledcocoapods-core-1.4.0.beta.1Fetching:claide-1.0.2.gem(100%)Successfullyinstalledclaide-1.0.2Fetching:cocoapods-deintegrate-1.0.1.gem(100%)Successfullyinstalledcocoapods-deintegrate-1.0.1Fetching:cocoapods-downloader-1.1.3.gem(100%)Successfullyinstalledcocoapods-downloader-1.1.3Fetching:cocoapods-plugins-1.0.0.gem(100%)Successfullyinstalledcocoapods-plugins-1.0.0Fetching:cocoapods-search-1.0.0.gem(100%)Successfullyinstalledcocoapods-search-1.0.0Fetching:cocoapods-stats-1.0.0.gem(100%)Successfullyinstalledcocoapods-stats-1.0.0Fetching:netrc-0.11.0.gem(100%)Successfullyinstallednetrc-0.11.0Fetching:cocoapods-trunk-1.3.0.gem(100%)Successfullyinstalledcocoapods-trunk-1.3.0Fetching:cocoapods-try-1.1.0.gem(100%)Successfullyinstalledcocoapods-try-1.1.0Fetching:molinillo-0.6.3.gem(100%)Successfullyinstalledmolinillo-0.6.3Fetching:CFPropertyList-2.3.5.gem(100%)SuccessfullyinstalledCFPropertyList-2.3.5Fetching:colored2-3.1.2.gem(100%)Successfullyinstalledcolored2-3.1.2Fetching:nanaimo-0.2.3.gem(100%)Successfullyinstallednanaimo-0.2.3Fetching:xcodeproj-1.5.2.gem(100%)Successfullyinstalledxcodeproj-1.5.2Fetching:escape-0.0.4.gem(100%)Successfullyinstalledescape-0.0.4Fetching:fourflusher-2.0.1.gem(100%)Successfullyinstalledfourflusher-2.0.1Fetching:gh_inspector-1.0.3.gem(100%)Successfullyinstalledgh_inspector-1.0.3Fetching:ruby-macho-1.1.0.gem(100%)Successfullyinstalledruby-macho-1.1.0Fetching:cocoapods-1.4.0.beta.1.gem(100%)Successfullyinstalledcocoapods-1.4.0.beta.1Parsingdocumentationforconcurrent-ruby-1.0.5Installingridocumentationforconcurrent-ruby-1.0.5Parsingdocumentationfori18n-0.9.0Installingridocumentationfori18n-0.9.0Parsingdocumentationforthread_safe-0.3.6Installingridocumentationforthread_safe-0.3.6Parsingdocumentationfortzinfo-1.2.3Installingridocumentationfortzinfo-1.2.3Parsingdocumentationforactivesupport-4.2.10Installingridocumentationforactivesupport-4.2.10Parsingdocumentationfornap-1.1.0Installingridocumentationfornap-1.1.0Parsingdocumentationforfuzzy_match-2.0.4Installingridocumentationforfuzzy_match-2.0.4Parsingdocumentationforcocoapods-core-1.4.0.beta.1Installingridocumentationforcocoapods-core-1.4.0.beta.1Parsingdocumentationforclaide-1.0.2Installingridocumentationforclaide-1.0.2Parsingdocumentationforcocoapods-deintegrate-1.0.1Installingridocumentationforcocoapods-deintegrate-1.0.1Parsingdocumentationforcocoapods-downloader-1.1.3Installingridocumentationforcocoapods-downloader-1.1.3Parsingdocumentationforcocoapods-plugins-1.0.0Installingridocumentationforcocoapods-plugins-1.0.0Parsingdocumentationforcocoapods-search-1.0.0Installingridocumentationforcocoapods-search-1.0.0Parsingdocumentationforcocoapods-stats-1.0.0Installingridocumentationforcocoapods-stats-1.0.0Parsingdocumentationfornetrc-0.11.0Installingridocumentationfornetrc-0.11.0Parsingdocumentationforcocoapods-trunk-1.3.0Installingridocumentationforcocoapods-trunk-1.3.0Parsingdocumentationforcocoapods-try-1.1.0Installingridocumentationforcocoapods-try-1.1.0Parsingdocumentationformolinillo-0.6.3Installingridocumentationformolinillo-0.6.3ParsingdocumentationforCFPropertyList-2.3.5InstallingridocumentationforCFPropertyList-2.3.5Parsingdocumentationforcolored2-3.1.2Installingridocumentationforcolored2-3.1.2Parsingdocumentationfornanaimo-0.2.3Installingridocumentationfornanaimo-0.2.3Parsingdocumentationforxcodeproj-1.5.2Installingridocumentationforxcodeproj-1.5.2Parsingdocumentationforescape-0.0.4Installingridocumentationforescape-0.0.4Parsingdocumentationforfourflusher-2.0.1Installingridocumentationforfourflusher-2.0.1Parsingdocumentationforgh_inspector-1.0.3Installingridocumentationforgh_inspector-1.0.3Parsingdocumentationforruby-macho-1.1.0Installingridocumentationforruby-macho-1.1.0Parsingdocumentationforcocoapods-1.4.0.beta.1Installingridocumentationforcocoapods-1.4.0.beta.1Doneinstallingdocumentationforconcurrent-ruby,i18n,thread_safe,tzinfo,activesupport,nap,fuzzy_match,cocoapods-core,claide,cocoapods-deintegrate,cocoapods-downloader,cocoapods-plugins,cocoapods-search,cocoapods-stats,netrc,cocoapods-trunk,cocoapods-try,molinillo,CFPropertyList,colored2,nanaimo,xcodeproj,escape,fourflusher,gh_inspector,ruby-macho,cocoapodsafter23seconds27gemsinstalled

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末旁涤,一起剝皮案震驚了整個(gè)濱河市翔曲,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌劈愚,老刑警劉巖瞳遍,帶你破解...
    沈念sama閱讀 217,907評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異菌羽,居然都是意外死亡掠械,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,987評論 3 395
  • 文/潘曉璐 我一進(jìn)店門算凿,熙熙樓的掌柜王于貴愁眉苦臉地迎上來份蝴,“玉大人犁功,你說我怎么就攤上這事氓轰。” “怎么了浸卦?”我有些...
    開封第一講書人閱讀 164,298評論 0 354
  • 文/不壞的土叔 我叫張陵署鸡,是天一觀的道長。 經(jīng)常有香客問我,道長靴庆,這世上最難降的妖魔是什么时捌? 我笑而不...
    開封第一講書人閱讀 58,586評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮炉抒,結(jié)果婚禮上奢讨,老公的妹妹穿的比我還像新娘。我一直安慰自己焰薄,他們只是感情好拿诸,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,633評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著塞茅,像睡著了一般亩码。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上野瘦,一...
    開封第一講書人閱讀 51,488評論 1 302
  • 那天描沟,我揣著相機(jī)與錄音,去河邊找鬼鞭光。 笑死吏廉,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的衰猛。 我是一名探鬼主播迟蜜,決...
    沈念sama閱讀 40,275評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼啡省!你這毒婦竟也來了娜睛?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,176評論 0 276
  • 序言:老撾萬榮一對情侶失蹤卦睹,失蹤者是張志新(化名)和其女友劉穎畦戒,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體结序,經(jīng)...
    沈念sama閱讀 45,619評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡障斋,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,819評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了徐鹤。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片垃环。...
    茶點(diǎn)故事閱讀 39,932評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖返敬,靈堂內(nèi)的尸體忽然破棺而出遂庄,到底是詐尸還是另有隱情,我是刑警寧澤劲赠,帶...
    沈念sama閱讀 35,655評論 5 346
  • 正文 年R本政府宣布涛目,位于F島的核電站秸谢,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏霹肝。R本人自食惡果不足惜估蹄,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,265評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望沫换。 院中可真熱鬧臭蚁,春花似錦、人聲如沸讯赏。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,871評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽待逞。三九已至甥角,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間识樱,已是汗流浹背嗤无。 一陣腳步聲響...
    開封第一講書人閱讀 32,994評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留怜庸,地道東北人当犯。 一個(gè)月前我還...
    沈念sama閱讀 48,095評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像割疾,于是被迫代替她去往敵國和親嚎卫。 傳聞我的和親對象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,884評論 2 354

推薦閱讀更多精彩內(nèi)容