如何使用 rbenv 在 virtualbox/ubunto 20.04 上下载 Ruby (<2.0)



我在使用rbenv安装Ruby时遇到问题,这似乎是一个openssl问题。我按了下面的链接,但没有成功

链接:OpenSSL安装Ruby 2.1错误。X和2.3。在Archlinux上安装ruby-install/ruby-build

https://github.com/rbenv/ruby-build/wiki openssl-sslv3_method-undeclared-error

Ubuntu 20.04OpenSSL 1.0.2ruby-build 20211019


scoop@scoop-VirtualBox:~$ rbenv install 1.9.3-p327
Downloading yaml-0.1.6.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/scoop/.rbenv/versions/1.9.3-p327
Downloading ruby-1.9.3-p327.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.bz2
Installing ruby-1.9.3-p327...
WARNING: ruby-1.9.3-p327 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

BUILD FAILED (Ubuntu 20.04 using ruby-build 20211019)
Inspect or clean up the working tree at /tmp/ruby-build.20211022151319.51817.ZFwydR
Results logged to /tmp/ruby-build.20211022151319.51817.log
Last 10 log lines:
|     ^~~~~~~~~~~~
ossl_ocsp.c: In function ‘ossl_ocspcid_get_serial’:
ossl_ocsp.c:694:1: warning: control reaches end of non-void function [-Wreturn-type]
694 | }
| ^
make[2]: *** [Makefile:267: ossl_ocsp.o] Error 1
make[2]: Leaving directory '/tmp/ruby-build.20211022151319.51817.ZFwydR/ruby-1.9.3-p327/ext/openssl'
make[1]: *** [exts.mk:126: ext/openssl/all] Error 2
make[1]: Leaving directory '/tmp/ruby-build.20211022151319.51817.ZFwydR/ruby-1.9.3-p327'
make: *** [uncommon.mk:178: build-ext] Error 2

我找到了Ubuntu>18.04没有正确的依赖关系来支持OpenSSL 1.0,所以我切换到18.04并做了以下操作:

# cd into source directory you downloaded and unarchived
./config --prefix=/opt/openssl-1.0 shared
make
make test
sudo make install
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/openssl-1.0" rbenv install <version>

这来自下面的链接:https://github.com/rbenv/ruby-build/wiki openssl-sslv3_method-undeclared-error

相关内容

  • 没有找到相关文章

最新更新