10
9

More than 5 years have passed since last update.

gemでTo eliminate this warning, please install libyaml and reinstall your ruby.のエラーが出た場合の対処

Posted at

環境

  • OSはMac OS X
  • rubyはHomebrewで入れた
  • libyamlはHomebrewで入れた
  • rubyがバージョン毎にいくつか入っていた。
    • 2.0系2つの内1つをメインで使っていた
    • 2.1.1を最近インストールしたが使ってはいない。

エラー内容

$ gem --version と打つも以下の様エラーが表示された。

$ gem -v

/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
...

対処方法

取り敢えずlibyamlを再インストール

$ brew uninstall libyaml
...

$ brew install libyaml
...

$ brew doctor
Your system is ready to brew.

使ってないrubyをアンインストール

まず、現在使っているrubyのバージョンを調べる

$ brew witch ruby
/usr/local/Cellar/ruby/2.0.0-p353/bin/ruby

2.0をちゃんとみてる…が、凄いあやしい…

とにかく、最新版のrubyがあやしいので取り敢えずrubyを消す。

$ brew uninstall ruby
Uninstalling /usr/local/Cellar/ruby/2.1.1...

やっぱりおかしい!最新版のrubyが削除された!

$ brew doctor
Your system is ready to brew.

$ gem -v
2.2.2

直ったみたいです。

10
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
9