我想在我的操作系统中有两个不同的OpenSSL版本。现在,openssl version -v
返回
OpenSSL 1.1.1f 2020年3月31日
我也想要OpenSSL 1.0.2,因为我需要在rbenv中安装Ruby 2.2.10,而对于2.4以下的版本,则需要降级OpenSSL。
如何在Ubuntu16.04上安装openssl 1.0.2和默认openssl (1.1.1)? -我在这个线程中跟踪了monaye的答案,并成功地安装了OpenSSL:openssl version -v
OpenSSL 1.0.2l 2017年5月25日
但是让操作系统使用OpenSSL可能会与我的Ruby3.0.0应用程序发生冲突,因为我需要这两个版本都可用。这就是为什么我将OpenSSL更新回其最新版本的原因。
rbenv的文档有一个在MacOS中解决此冲突:
使用Homebrew on macOS brew安装rbenv/tap/openssl@1.0 macOS--前缀openssl@1.0)“rbenv安装2.3.8
在Ubuntu20.04中,我需要类似的东西--有可能吗?
在rbenv论坛中,在OpenSSL版本兼容性下面
当构建Ruby2.3或更高版本时,您必须确保OpenSSL 1.0在系统的某个地方可用,并通过--带有-openssl配置标志指向它。目前,OpenSSL 1.1附带的大多数OpenSSL发行版都为OpenSSL 1.0提供了一个单独的包。
但
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" rbenv install 2.3.8
失败:Command 'brew' not found
发布于 2021-03-23 14:56:13
这是我找到的解决方案,只要稍加调整就可以了。感谢EliKazap编辑/etc/apt/sources.list
并在文件末尾添加以下内容:deb http://security.ubuntu.com/ubuntu bionic-security main
然后
Run sudo apt-get update && apt-cache policy libssl1.0-dev
Run sudo apt-get install libssl1.0-dev
检查./usr/local/ssl/bin/openssl version
版本是否正确
然后
RUBY_CONFIGURE_OPTS="--with-openssl-dir='/usr/local/ssl/bin'" rbenv install 2.2.10
发布于 2023-05-11 15:46:20
如果您以标准的方式编译openssl,标准的--with-openssl-dir
解决方案工作得很好,但是在某些linux发行版中,它们有多个版本的openssl已经以非标准的方式编译过。例如,EPEL在RHEL/CentOS 7上提供了openssl11。
RUBY_CONFIGURE_OPTS='--with-openssl-dir=/usr/include/openssl11 --with-openssl-lib=/usr/lib64/openssl11 --with-openssl-include=/usr/include/openssl11' rbenv install 3.2.2
https://askubuntu.com/questions/1325334
复制相似问题