构建失败(使用 ruby​​-build 20211203 (ruby 3.0.2) 的 macOS 12.1) macOS Monterey

Qua*_*Anh 7 ruby-on-rails system ruby-build

升级到最新的 macOS (Monterey) 后,我无法安装新的 ruby​​ 版本 (3.0.2)。有人遇到过类似的问题并且能够解决吗?

Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/hoquanganh/.rbenv/versions/3.0.2

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

BUILD FAILED (macOS 12.1 using ruby-build 20211227)

Run Code Online (Sandbox Code Playgroud)

我尝试过一些方法,但对我来说不起作用

RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 3.0.2

RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl@1.1`" rbenv install 3.0.2
Run Code Online (Sandbox Code Playgroud)

如果您有任何想法可以使这项工作成功,请告诉我,谢谢。

小智 19

我的新 MBP M1 Pro 与 Monterey v12.1 也存在同样的问题。我能够使用以下命令毫无问题地运行它

RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC arch -arm64 rbenv install 2.7.2
Run Code Online (Sandbox Code Playgroud)