YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).

升級到 xcode9.0 之后使用 安裝cocoapods 會出現(xiàn)如下情況:

Air:~ Jniying$ sudo gem install cocoapods
Password:
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org/ - Errno::ECONNREFUSED: Connection refused - connect(2) (https://gems.ruby-china.org/specs.4.8.gz)

YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0). 這個(gè)是什么鬼??

查看ruby版本

rvm list known
[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]

我當(dāng)前版本是 2.0.0
嘗試去更新 ruby 到最新的

rvm install 2.4.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.4.1.
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..There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
-
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
..
Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config coreutils libyaml readline libksba openssl@1.1',
please read /Users/Jniying/.rvm/log/1512703462_ruby-2.4.1/package_install_autoconf_automake_libtool_pkg-config_coreutils_libyaml_readline_libksba_openssl@1.1.log
Requirements installation failed with status: 1.

表示好難過 更新不了rudy 就 安裝不了cocoapods

新大陸: Try brew tap --repair and make sure brew doctor looks reasonable.

嘗試一下 這個(gè)兩個(gè)命名:

brew doctor
//叫我們下載下面的工具
Warning: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
  xcode-select --install

//xcode 9.0沖突
Warning: Your Xcode (9.0.1) is outdated.
Please update to Xcode 9.1 (or delete it).
Xcode can be updated from the App Store.

// openssl 沖突
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install openssl

下載 Install the Command Line Tools

xcode-select --install

跳出一個(gè)窗口下載, 完成之后

brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2n.sierra.bottl
######################################################################## 100.0%
==> Pouring openssl-1.0.2n.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
??  /usr/local/Cellar/openssl/1.0.2n: 1,792 files, 12.3MB

更新完 openssl

再次嘗試 安裝最新的rudy

rvm install 2.4.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.4.1.
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 bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Jniying/.rvm/rubies/ruby-2.4.1, this may take a while depending on your cpu(s)...
ruby-2.4.1 - #downloading ruby-2.4.1, 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 11.9M  100 11.9M    0     0  13809      0  0:15:10  0:15:10 --:--:-- 10573
ruby-2.4.1 - #extracting ruby-2.4.1 to /Users/Jniying/.rvm/src/ruby-2.4.1....
ruby-2.4.1 - #applying patch /Users/Jniying/.rvm/patches/ruby/2.4.1/random_c_using_NR_prefix.patch.
ruby-2.4.1 - #configuring......................................................-
ruby-2.4.1 - #post-configuration.
ruby-2.4.1 - #compiling........................................................-
ruby-2.4.1 - #installing.......
ruby-2.4.1 - #making binaries executable..
ruby-2.4.1 - #downloading rubygems-2.6.14
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  751k  100  751k    0     0   676k      0  0:00:01  0:00:01 --:--:--  676k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.4.1 - #extracting rubygems-2.6.14....
ruby-2.4.1 - #removing old rubygems.........
ruby-2.4.1 - #installing rubygems-2.6.14...........................
ruby-2.4.1 - #gemset created /Users/Jniying/.rvm/gems/ruby-2.4.1@global
ruby-2.4.1 - #importing gemset /Users/Jniying/.rvm/gemsets/global.gems.........|
ruby-2.4.1 - #generating global wrappers........
ruby-2.4.1 - #gemset created /Users/Jniying/.rvm/gems/ruby-2.4.1
ruby-2.4.1 - #importing gemsetfile /Users/Jniying/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.1 - #generating default wrappers........
ruby-2.4.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.4.1 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

成功了.

安裝 cocoapods

sudo gem install cocoapods

完美謝幕.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末讼溺,一起剝皮案震驚了整個(gè)濱河市负拟,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌盏阶,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,204評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異忘晤,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)激捏,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,091評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來凄吏,“玉大人远舅,你說我怎么就攤上這事『鄹郑” “怎么了图柏?”我有些...
    開封第一講書人閱讀 164,548評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長任连。 經(jīng)常有香客問我蚤吹,道長,這世上最難降的妖魔是什么随抠? 我笑而不...
    開封第一講書人閱讀 58,657評論 1 293
  • 正文 為了忘掉前任裁着,我火速辦了婚禮,結(jié)果婚禮上拱她,老公的妹妹穿的比我還像新娘二驰。我一直安慰自己,他們只是感情好秉沼,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,689評論 6 392
  • 文/花漫 我一把揭開白布桶雀。 她就那樣靜靜地躺著矿酵,像睡著了一般。 火紅的嫁衣襯著肌膚如雪矗积。 梳的紋絲不亂的頭發(fā)上全肮,一...
    開封第一講書人閱讀 51,554評論 1 305
  • 那天,我揣著相機(jī)與錄音棘捣,去河邊找鬼辜腺。 笑死,一個(gè)胖子當(dāng)著我的面吹牛柱锹,可吹牛的內(nèi)容都是我干的哪自。 我是一名探鬼主播,決...
    沈念sama閱讀 40,302評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼禁熏,長吁一口氣:“原來是場噩夢啊……” “哼壤巷!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起瞧毙,我...
    開封第一講書人閱讀 39,216評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎宙彪,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體释漆,經(jīng)...
    沈念sama閱讀 45,661評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,851評論 3 336
  • 正文 我和宋清朗相戀三年男图,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了示姿。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,977評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡逊笆,死狀恐怖栈戳,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情难裆,我是刑警寧澤子檀,帶...
    沈念sama閱讀 35,697評論 5 347
  • 正文 年R本政府宣布,位于F島的核電站乃戈,受9級特大地震影響褂痰,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜症虑,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,306評論 3 330
  • 文/蒙蒙 一脐恩、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧侦讨,春花似錦驶冒、人聲如沸苟翻。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,898評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽崇猫。三九已至,卻和暖如春需忿,著一層夾襖步出監(jiān)牢的瞬間诅炉,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,019評論 1 270
  • 我被黑心中介騙來泰國打工屋厘, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留涕烧,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,138評論 3 370
  • 正文 我出身青樓汗洒,卻偏偏與公主長得像议纯,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子溢谤,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,927評論 2 355

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