在 macOS M2 上使用 rbenv 安装 Ruby 3.2.2:缺少 psych 和 libyaml 问题

问题描述 投票:0回答:2

我在配备 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
ruby rubygems rbenv psych
2个回答
1
投票

解决方法在报错信息中。您可能只需要安装

libyaml

尝试:

brew install libyaml

0
投票

我在 Ubuntu 22.04 中遇到了完全相同的问题。 为我修复的是

gem uninstall psych

再试一次

© www.soinside.com 2019 - 2024. All rights reserved.