cocoapods安裝的大坑

當(dāng)你按現(xiàn)有的順序安裝cocoapods的時(shí)候

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

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

2.使用淘寶鏡像

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

3.驗(yàn)證當(dāng)前ruby版本

$gem sources -l

成功后提示:

*** CURRENT SOURCES ***

https://ruby.taobao.org/

4.開始安裝cocoapods

$sudo gem install cocoa pods

這時(shí)候會(huì)出現(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)我們的版本確實(shí)太低了,這時(shí)候終端輸入rvm install 2.2.2

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

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

錯(cuò)誤提示:

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

這回就應(yīng)該可以安裝cocoapods了

安裝cocoa pods命令:sudo gem install cocoapods

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容