我在配备 M2 CPU 的 Mac 上使用 rbenv。我安装了 ruby 2.7.2,还想安装 ruby 3.2.2。运行 rbenv install 3.2.2 时,出现以下错误:
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
解决方法在报错信息中。您可能只需要安装
libyaml
尝试:
brew install libyaml
我在 Ubuntu 22.04 中遇到了完全相同的问题。 为我修复的是
gem uninstall psych
再试一次