在Mint 18上安装Ruby时发生OpenSSL编译错误
我已经在Windows下的虚拟机上安装了LinuxMint18。当我尝试安装一些rubies时,我总是在安装过程的同一点出错。我正在使用ruby安装,但也尝试了ruby构建,结果相同。我猜他们基本上在做同样的事情 我需要安装ruby 1.9.3来处理一个旧项目,但它失败了,p448和p551都失败了。一些Ruby 2.x也会失败。我已经得到2.1.9p490完全编译 根据我找到的其他建议,我已经确保安装了openssl和libssl dev,并且都是最新版本。谁能告诉我发生了什么事以及如何修复 以下是它失败的地方:在Mint 18上安装Ruby时发生OpenSSL编译错误,ruby,linux-mint,Ruby,Linux Mint,我已经在Windows下的虚拟机上安装了LinuxMint18。当我尝试安装一些rubies时,我总是在安装过程的同一点出错。我正在使用ruby安装,但也尝试了ruby构建,结果相同。我猜他们基本上在做同样的事情 我需要安装ruby 1.9.3来处理一个旧项目,但它失败了,p448和p551都失败了。一些Ruby 2.x也会失败。我已经得到2.1.9p490完全编译 根据我找到的其他建议,我已经确保安装了openssl和libssl dev,并且都是最新版本。谁能告诉我发生了什么事以及如何修复
compiling ossl_ssl.c
ossl_ssl.c:116:27: error: ‘SSLv3_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c:117:27: error: ‘SSLv3_server_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3_server),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c:118:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3_client),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c: In function ‘ossl_sslctx_session_new_cb’:
ossl_ssl.c:382:35: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, ssl_obj, sess_obj, ret_obj;
^
ossl_ssl.c: In function ‘ossl_sslctx_session_remove_cb’:
ossl_ssl.c:431:38: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, sslctx_obj, sess_obj, ret_obj;
^
ossl_ssl.c: In function ‘ssl_servername_cb’:
ossl_ssl.c:508:25: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, ssl_obj, ret_obj;
^
Makefile:269: recipe for target 'ossl_ssl.o' failed
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory '/usr/local/src/ruby-1.9.3-p448/ext/openssl'
exts.mk:126: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory '/usr/local/src/ruby-1.9.3-p448'
uncommon.mk:178: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
!!! Compiling ruby 1.9.3-p448 failed!
我花了几个小时试图弄明白这一点,并在我发布后立即找到了答案。希望它能帮助其他人 一些Ruby版本和一些OpenSSL版本之间存在问题。修复方法是为您尝试安装的Ruby版本找到补丁。我找到了除1.9.3(我所需要的)之外的许多版本的补丁,所以它们已经存在了。(我还是试过了,但在尝试安装1.9.3时,补丁总是失败。) 终于在archlinux论坛上的讨论中找到了1.9.3的正确补丁 通过讨论,可以在此处找到正确的修补程序: 下载补丁,然后在使用您选择的Ruby安装程序编译时应用它。它们都有应用补丁的开关 有了这个补丁,我能够在我的系统上成功地安装ruby-1.9.3-p551