英文:
Installing Ruby 3.2.2 using rbenv on macOS M2: Missing psych and libyaml issues
问题
我在使用Mac上的M2 CPU上使用rbenv。我已经安装了Ruby 2.7.2,并希望安装Ruby 3.2.2。当运行"rbenv install 3.2.2"时,我遇到以下错误:
yaml.rb:3: warning: 似乎您的Ruby安装缺少psych(用于YAML输出)。
为了消除这个警告,请安装libyaml并重新安装Ruby。
Ruby的yaml扩展没有被编译。
错误:由于缺少扩展,Ruby安装中止
英文:
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
答案1
得分: 2
解决方案在错误消息中。您可能只需安装 libyaml
尝试:
brew install libyaml
英文:
The solution is in the error message. You probably just need to install libyaml
Try:
brew install libyaml
答案2
得分: 1
我在Ubuntu 22.04上遇到了完全相同的问题。
修复方法是:
gem uninstall psych
gem uninstall openssl
然后再尝试。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论