2

I am using rbenv on a Mac with an M2 CPU. I have ruby 2.7.2 installed and want to also install ruby 3.2.2. When running rbenv install 3.2.2, I get the following error:

yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
polo
  • 1,352
  • 2
  • 16
  • 35

2 Answers2

2

The solution is in the error message. You probably just need to install libyaml

Try:

brew install libyaml
Paniko0
  • 528
  • 5
  • 11
  • Is there a superior version of Ruby available that does not have this deficiency? Installing libyaml requires me to also go document this task for my Windows and Linux friends... and then go update Docker configurations and GitHub CI workflows... – William Entriken Apr 23 '23 at 02:02
  • 1
    @WilliamEntriken I don't think there's an alternative as of now. The `libyaml` uses to come bundled with the `psych` gem. It seems like the Ruby team is trying to unbundle dependencies (I don't have any context about the reasoning behind this decision nor time to look into it now) and libyaml is part of that effort. You can probably get more info by reading the changes here, the description link and the associated PR's on multiple repositories linked to this PR: https://github.com/ruby/psych/pull/541 – Paniko0 Apr 29 '23 at 17:19
1

I had the exact same problem in Ubuntu 22.04. What fixed it for me was

gem uninstall psych
gem uninstall openssl

and trying again

user752963
  • 46
  • 3