我有一个使用 ruby 2.1.0 的遗留应用程序 $ rbenv 安装 2.1.0 在 BigSur 中运行良好。
但是,从 Big Sur 11 更新到 MacOS 14.4.1 Sonoma 后,我无法让它工作。 我已经用干净的 git 安装替换了旧的 rbenv 版本,并成功
$ rbenv -v
rbenv 1.2.0-87-ge8b7a27
我在升级到 Sonoma 后安装了 XCode 命令工具。 我正在使用 MacPorts,并且我已按照他们的说明重新安装了所有端口。
$ uname -a
Darwin xoco6p.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64 x86_64
$ rbenv install 2.1.0
==> Installing yaml-0.1.6...
-> ./configure "--prefix=$HOME/.rbenv/versions/2.1.0"
-> make -j 12
-> make install
==> Installed yaml-0.1.6 to /Users/jose/.rbenv/versions/2.1.0
==> Installing openssl-1.0.2u...
-> ./config "--prefix=$HOME/.rbenv/versions/2.1.0/openssl" "--openssldir=$HOME/.rbenv/versions/2.1.0/openssl/ssl" zlib-dynamic no-ssl3 shared no-ssl2 no-krb5
-> make -j 12
BUILD FAILED (macOS 14.4.1 on x86_64 using ruby-build 20240416)
You can inspect the build directory at /Users/jose/MyTemp/ruby-build.20240424214638.52529.gppzyT
See the full build log at /Users/jose/MyTemp/ruby-build.20240424214638.52529.log
日志文件显示配置openssl make文件失败:
$ less /Users/jose/MyTemp/ruby-build.20240424214638.52529.log
.........
==> Installed yaml-0.1.6 to /Users/jose/.rbenv/versions/2.1.0
cd /Users/jose/MyTemp/ruby-build.20240424214638.52529.gppzyT
-> tar xzf openssl-1.0.2u.tar.gz
cd /Users/jose/MyTemp/ruby-build.20240424214638.52529.gppzyT/openssl-1.0.2u
==> Installing openssl-1.0.2u...
-> ./config "--prefix=$HOME/.rbenv/versions/2.1.0/openssl" "--openssldir=$HOME/.rbenv/versions/2.1.0/openssl/ssl" zlib-dynamic no-ssl3 shared no-ssl2 no-krb5
Operating system: i686-apple-darwinDarwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64
WARNING! If you wish to build 64-bit library, then you have to
invoke './Configure darwin64-x86_64-cc' *manually*.
Configuring for darwin-i386-cc
.........
"_time", referenced from:
_CRYPTO_dbg_malloc in libcrypto.a(mem_dbg.o)
_bnrand in libcrypto.a(bn_rand.o)
_RAND_poll in libcrypto.a(rand_unix.o)
_ASN1_TIME_diff in libcrypto.a(a_time.o)
_X509_cmp_time in libcrypto.a(x509_vfy.o)
_X509_time_adj in libcrypto.a(x509_vfy.o)
_X509_gmtime_adj in libcrypto.a(x509_vfy.o)
...
(maybe you meant: _X509_cmp_time, _TS_TST_INFO_set_time , _X509_time_adj , _X509_STORE_CTX_set_time , _err_clear_last_constant_time , _TS_RESP_CTX_set_time_cb , _PKCS7_add0_attrib_signing_time , _X509_VERIFY_PARAM_set_time , _ASN1_UTCTIME_cmp_time_t , _X509_time_adj_ex , _TS_TST_INFO_get_time , _X509_cmp_current_time )
"_vfprintf", referenced from:
_OPENSSL_showfatal in libcrypto.a(cryptlib.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [link_a.darwin] Error 1
make[3]: *** [do_darwin-shared] Error 2
make[2]: *** [libcrypto.1.0.0.dylib] Error 2
make[1]: *** [shared] Error 2
make: *** [build_crypto] Error 1
external command failed with status 2
似乎无法配置 x86_64,并继续 i386。
你能帮我看看如何使用 rbenv 安装 ruby 2.1.0 吗?
最好的,
何塞·安布罗斯-英格森
这是一个非常烦人的问题,但我相信这是最新 OpenSSL 版本的问题..与我在
rvm
中使用不同版本时遇到的问题非常相似
rvm install 3.3.0 --with-openssl-dir=$(brew --prefix openssl)
尝试使用额外的 rbenv 安装
--with-openssl-dir=$(brew --prefix openssl)