cocoapods安裝的大坑

當你按現(xiàn)有的順序安裝cocoapods的時候

1.移除現(xiàn)有的Ruby

$gem sources --remove https://rubygems.org/

2.使用淘寶鏡像

$gem sources -a https://ruby.taobao.org/

3.驗證當前ruby版本

$gem sources -l

成功后提示:

*** CURRENT SOURCES ***

https://ruby.taobao.org/

4.開始安裝cocoapods

$sudo gem install cocoa pods

這時候會出現(xiàn)提示离例,需要你升級Ruby

使用ruby -v查看你現(xiàn)有的版本

結(jié)果是:ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

使用ruby list known查看ruby所有版本

如果提示command not found 請先安裝rvm

curl -L get.rvm.io | bash -s stable(安裝ram命令)


查看ruby版本后發(fā)現(xiàn)我們的版本確實太低了,這時候終端輸入rvm install 2.2.2

如果出現(xiàn)這種錯誤:

Searching for binary rubies, this might take some time.

Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2

Checking requirements for osx.

Installing requirements for osx.

Updating system.........

Error running 'requirements_osx_brew_update_system ruby-2.2.2',

showing last 15 lines of /Users/chuanchunli/.rvm/log/1473597554_ruby-2.2.2/update_system.log

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.'

++ rvm_pretty_print stderr

++ case "${rvm_pretty_print_flag:=auto}" in

++ case "${TERM:-dumb}" in

++ case "$1" in

++ [[ -t 2 ]]

++ return 1

++ printf %b 'Failed to update Homebrew, follow instructions here:

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.\n'

Failed to update Homebrew, follow instructions here:

https://github.com/Homebrew/homebrew/wiki/Common-Issues

and make sure `brew update` works before continuing.

++ return 1

Requirements installation failed with status: 1.


不要著急,下面告訴大家怎么做鄙信,本人在這里卡了一天

終端輸入

brew doctor

錯誤提示:

Please note that these warnings are just used to help the Homebrew maintainers

with debugging if you file an issue. If everything you use Homebrew for is

working fine: please don't worry and just ignore them. Thanks!

Warning: The following directories are not writable:

/usr/local/share/man

This can happen if you "sudo make install" software that isn't managed

by Homebrew. If a formula tries to write a file to this directory, the

install will fail during the link step.

You should change the ownership and permissions of these directories.

back to your user account.

sudo chown -R $(whoami) /usr/local/share/man

Warning: You have unlinked kegs in your Cellar

Leaving kegs unlinked can lead to build-trouble and cause brews that depend on

those kegs to fail to run properly once built. Run `brew link` on these:

autoconf

libgpg-error

libtool

pig-config

在輸入

sudo chown -R $(whoami) /usr/local/share/man

然后輸入

brew link autoconf

brew link libgpg-error

brew link libtool

brew link pig-config

最后再次輸入rvm install 2.2.2

這回就應該可以安裝cocoapods了

安裝cocoa pods命令:sudo gem install cocoapods

最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末惑申,一起剝皮案震驚了整個濱河市滞详,隨后出現(xiàn)的幾起案子建椰,更是在濱河造成了極大的恐慌搪柑,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,509評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件编振,死亡現(xiàn)場離奇詭異缀辩,居然都是意外死亡,警方通過查閱死者的電腦和手機踪央,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評論 3 394
  • 文/潘曉璐 我一進店門臀玄,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人畅蹂,你說我怎么就攤上這事健无。” “怎么了液斜?”我有些...
    開封第一講書人閱讀 163,875評論 0 354
  • 文/不壞的土叔 我叫張陵累贤,是天一觀的道長。 經(jīng)常有香客問我少漆,道長臼膏,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,441評論 1 293
  • 正文 為了忘掉前任检疫,我火速辦了婚禮讶请,結(jié)果婚禮上祷嘶,老公的妹妹穿的比我還像新娘屎媳。我一直安慰自己夺溢,他們只是感情好,可當我...
    茶點故事閱讀 67,488評論 6 392
  • 文/花漫 我一把揭開白布烛谊。 她就那樣靜靜地躺著风响,像睡著了一般。 火紅的嫁衣襯著肌膚如雪丹禀。 梳的紋絲不亂的頭發(fā)上状勤,一...
    開封第一講書人閱讀 51,365評論 1 302
  • 那天,我揣著相機與錄音双泪,去河邊找鬼持搜。 笑死,一個胖子當著我的面吹牛焙矛,可吹牛的內(nèi)容都是我干的葫盼。 我是一名探鬼主播,決...
    沈念sama閱讀 40,190評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼村斟,長吁一口氣:“原來是場噩夢啊……” “哼贫导!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起蟆盹,我...
    開封第一講書人閱讀 39,062評論 0 276
  • 序言:老撾萬榮一對情侶失蹤孩灯,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后逾滥,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體峰档,經(jīng)...
    沈念sama閱讀 45,500評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,706評論 3 335
  • 正文 我和宋清朗相戀三年寨昙,在試婚紗的時候發(fā)現(xiàn)自己被綠了面哥。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,834評論 1 347
  • 序言:一個原本活蹦亂跳的男人離奇死亡毅待,死狀恐怖尚卫,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情尸红,我是刑警寧澤吱涉,帶...
    沈念sama閱讀 35,559評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站外里,受9級特大地震影響怎爵,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜盅蝗,卻給世界環(huán)境...
    茶點故事閱讀 41,167評論 3 328
  • 文/蒙蒙 一鳖链、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦芙委、人聲如沸逞敷。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽推捐。三九已至,卻和暖如春侧啼,著一層夾襖步出監(jiān)牢的瞬間牛柒,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評論 1 269
  • 我被黑心中介騙來泰國打工痊乾, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留皮壁,地道東北人。 一個月前我還...
    沈念sama閱讀 47,958評論 2 370
  • 正文 我出身青樓哪审,卻偏偏與公主長得像闪彼,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子协饲,可洞房花燭夜當晚...
    茶點故事閱讀 44,779評論 2 354

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