在Mac Catalina OS上,当使用rbenv安装Ruby时,我得到了这个错误。
Last 10 log lines:
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/dev/.rbenv/versions/2.5.8
--with-openssl-dir=/usr/local/opt/openssl@1.1
--enable-shared
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/dev/.rbenv/versions/2.5.8/lib
CPPFLAGS=-I/Users/dev/.rbenv/versions/2.5.8/include
编辑-我已经附上了我找到的解决方案,并为我工作。我希望这对其他人也有帮助。
发布于 2021-03-24 20:12:02
问题出在OpenSSL上。OpenSSL CommandLine Tools是随OpenSSL 1.1一起提供的,而您需要Mac 1.0。这就是它的解决方案
$ brew install rbenv/tap/openssl@1.0
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" rbenv install 2.5.8
这将安装Ruby 2.5.8。别忘了设置
rbenv global 2.5.8
要让它正常工作
https://stackoverflow.com/questions/66788644
复制