1

当我跑

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl@3/3.0.1 rbenv install 3.1.0

我得到这个输出:

Downloading ruby-3.1.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz
Installing ruby-3.1.0...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.6.2 using ruby-build 20211227-3-gcdc215e)

Inspect or clean up the working tree at /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.FVpqjp
Results logged to /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.log

Last 10 log lines:
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/jeremy/.rbenv/versions/3.1.0
  --enable-shared
  --with-readline-dir=/usr/local/opt/readline
  --with-openssl-dir=/usr/local/Cellar/openssl@3/3.0.1
  CC=clang
  LDFLAGS=-L/Users/jeremy/.rbenv/versions/3.1.0/lib
  CPPFLAGS=-I/Users/jeremy/.rbenv/versions/3.1.0/include

我在日志中看不到任何线索。我已经尝试了很多东西,比如重新安装 rbenv 和 openssl,没有指定配置选项、系统更新、安装 xcode 以及来自 google 的更多东西。也许我错过了一些东西。

4

1 回答 1

0

Ruby(还)不支持 OpenSSL 3.0。在https://github.com/ruby/openssl/issues/369中跟踪了对这个较新版本的实现支持

现在,您必须改用 Openssl 1.1,您可以使用它进行安装

brew install openssl@1.1
于 2022-01-13T16:01:47.803 回答