mac os 如何更新Ruby

1 掸犬、執(zhí)行pod update 報(bào)錯(cuò)如下

[!] /bin/bash -c

set -e

sh build.sh cocoapods-setup

./scripts/swift-version.sh: line 59: [: =: unary operator expected

No version of Xcode found that supports Swift 2.2

2、檢查pod ?版本 和ruby 版本

?? pod --version

1.2.1.beta.1

? ruby --version

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15] ? ? ?

3 簇爆、升級(jí)ruby ??


先參考ruby升級(jí)鏈接ruby升級(jí)鏈接

安裝ruby版本管理器rvm

#1召烂、? RVM安裝

$ curl -L get.rvm.io | bash -s stable

# 2厚骗、 ?之后就是等待一段時(shí)間之后赡译,就可以安裝成功了共啃,使用以下命令來(lái)驗(yàn)證

$ source ~/.bashrc

$?source?~/.bash_profile

# 3居扒、 測(cè)試是否安裝正常

$ rvm -v


#1概漱、查看當(dāng)前ruby版本

$?ruby?-v

這一步會(huì)顯示出來(lái)當(dāng)前ruby的版本

#2、列出已知ruby的版本

$ rvm list known

稍等一下喜喂,會(huì)出現(xiàn)很多平臺(tái)不同的ruby的版本瓤摧,我因?yàn)槭切枰?.2.2以上的版本,所以直接安裝2.2.4版本

#3夜惭、安裝ruby 2.2.4

$?rvm?install 2.2.4


解釋安裝總是沒(méi)有一帆風(fēng)順的

1姻灶、$ rvm install 2.2.4 會(huì)出現(xiàn)報(bào)錯(cuò) ?

?? rvm install 2.2.4

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.4.tar.bz2

Checking requirements for osx.

Installing requirements for osx.

Updating system........

Error running 'requirements_osx_brew_update_system ruby-2.2.4',

showing last 15 lines of /Users/SY_jinjinzhou/.rvm/log/1489975304_ruby-2.2.4/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.


2、根據(jù)提示需要更新brew

?? brew update

Error: /usr/local must be writable!


更新brew依然報(bào)錯(cuò)

可參考鏈接:http://securityer.lofter.com/post/1d0f3ee7_bcf5f05

大致過(guò)程是 執(zhí)行? brew doctor ?命令 會(huì)顯示如下

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: /usr/local is not writable.

You should probably change the ownership and permissions of /usr/local

back to your user account.

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

Warning: /usr/local is not writable.

Even if this directory was writable when you installed Homebrew, other

software may change permissions on this directory. For example, upgrading

to OS X El Capitan has been known to do this. Some versions of the

"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations

are known to do this as well.

You should probably change the ownership and permissions of /usr/local

back to your user account.

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

Warning: Your Homebrew is outdated.

You haven't updated for at least 24 hours. This is a long time in brewland!

To update Homebrew, run `brew update`.


接著

?? sudo chown -R $(whoami) /usr/local

Password:

?? Toon git:(develop) ? brew update

/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory

/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory

/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory

/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory

/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory

Error: update-report should not be called directly!


依然報(bào)錯(cuò)? 再執(zhí)行一遍brew update

? brew update

執(zhí)行結(jié)果類(lèi)似如下

Updated 1 tap (homebrew/core).

==> Cleaning up /Library/Caches/Homebrew...

Removing: /Library/Caches/Homebrew/autojump-22.3.0.el_capitan.bottle.tar.gz.incomplete... (24KB)

Removing: /Library/Caches/Homebrew/autojump-22.3.0.tar.gz... (51.7KB)

Removing: /Library/Caches/Homebrew/zsh-completions-0.17.0.tar.gz... (216.0KB)

==> Migrating /Library/Caches/Homebrew to /Users/SY_jinjinzhou/Library/Caches/Homebrew...

==> Deleting /Library/Caches/Homebrew...

………………


查看Ruby版本 安裝ruby

?? rvm list known

?? rvm install 2.4

執(zhí)行結(jié)果如下?

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.11/x86_64/ruby-2.4.0.

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: autoconf, automake, libtool, pkg-config, coreutils, libyaml, readline, libksba, openssl@1.1..........

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

Requirements installation successful.

Installing Ruby from source to: /Users/SY_jinjinzhou/.rvm/rubies/ruby-2.4.0, this may take a while depending 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? Speed

9 11.9M? ? 9 1159k? ? 0? ? 0? ? 659? ? ? 0? 5:17:58? 0:29:58? 4:48:00? ? 0Warning: Transient problem: timeout Will retry in 2 seconds. 3 retries left.


等待安裝

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

……

There was an error(56).

Checking fallback: https://ftp.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2

No fallback URL could be found, try increasing timeout with:

echo "export rvm_max_time_flag=20" >> ~/.rvmrc

There has been an error fetching the ruby interpreter. Halting the installation.

重新執(zhí)行? rvm install 2.4

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末诈茧,一起剝皮案震驚了整個(gè)濱河市产喉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌敢会,老刑警劉巖曾沈,帶你破解...
    沈念sama閱讀 217,185評(píng)論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異鸥昏,居然都是意外死亡塞俱,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,652評(píng)論 3 393
  • 文/潘曉璐 我一進(jìn)店門(mén)吏垮,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)障涯,“玉大人,你說(shuō)我怎么就攤上這事膳汪∥ǖ” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 163,524評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵遗嗽,是天一觀的道長(zhǎng)粘我。 經(jīng)常有香客問(wèn)我,道長(zhǎng)痹换,這世上最難降的妖魔是什么征字? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,339評(píng)論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮娇豫,結(jié)果婚禮上匙姜,老公的妹妹穿的比我還像新娘。我一直安慰自己冯痢,他們只是感情好氮昧,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,387評(píng)論 6 391
  • 文/花漫 我一把揭開(kāi)白布或详。 她就那樣靜靜地躺著,像睡著了一般郭计。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上椒振,一...
    開(kāi)封第一講書(shū)人閱讀 51,287評(píng)論 1 301
  • 那天昭伸,我揣著相機(jī)與錄音,去河邊找鬼澎迎。 笑死庐杨,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的夹供。 我是一名探鬼主播灵份,決...
    沈念sama閱讀 40,130評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼哮洽!你這毒婦竟也來(lái)了填渠?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 38,985評(píng)論 0 275
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤鸟辅,失蹤者是張志新(化名)和其女友劉穎氛什,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體匪凉,經(jīng)...
    沈念sama閱讀 45,420評(píng)論 1 313
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡枪眉,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,617評(píng)論 3 334
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了再层。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片贸铜。...
    茶點(diǎn)故事閱讀 39,779評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖聂受,靈堂內(nèi)的尸體忽然破棺而出蒿秦,到底是詐尸還是另有隱情,我是刑警寧澤饺饭,帶...
    沈念sama閱讀 35,477評(píng)論 5 345
  • 正文 年R本政府宣布渤早,位于F島的核電站,受9級(jí)特大地震影響瘫俊,放射性物質(zhì)發(fā)生泄漏鹊杖。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,088評(píng)論 3 328
  • 文/蒙蒙 一扛芽、第九天 我趴在偏房一處隱蔽的房頂上張望骂蓖。 院中可真熱鬧,春花似錦川尖、人聲如沸登下。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,716評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)被芳。三九已至缰贝,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間畔濒,已是汗流浹背剩晴。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,857評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留侵状,地道東北人赞弥。 一個(gè)月前我還...
    沈念sama閱讀 47,876評(píng)論 2 370
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像趣兄,于是被迫代替她去往敵國(guó)和親绽左。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,700評(píng)論 2 354

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