最近在ArchLinux上的OpenSSL更新破坏了Ruby,因为后者依赖于前者支持的SSLv3。使用OpenSSL的Ruby代码将在终止时出现如下错误的问题:
openssl.so: undefined symbol: SSLv3_method - .../openssl.so (LoadError)
我使用带有RVM的多个Ruby版本,问题适用于所有版本。
我遇到问题的OpenSSL版本是1.0.2h
,但我相信它是1.0.2g
引入的。版本1.0.2f
运行正常。
如何克服兼容性问题(没有降级OpenSSL )?
答案 0 :(得分:14)
问题是由于this commit之前没有支持SSLv3而构建的ArchLinux OpenSSL包引起的。我相信在Ubuntu等其他发行版中也做过类似的事情。
RVM环境中的解决方案是重新安装将重建它们的Rubies(您可能还希望更新到最新的rvm):
$ rvm get head # optional, if you want to!
$ rvm reinstall all # or a specifc ruby version instead of 'all'
但是,旧的rubies仍然会因为编译错误而失败:
Error running '__rvm_make -j1'
ossl_ssl.c:143:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
对于已建议安装discussed的RVM团队,这已经this Ruby patch,允许旧版红宝石构建:
$ curl https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff > openssl.patch
$ rvm install --patch ./openssl.patch 1.9.3-p194
我使用此修补程序成功构建了ruby-1.9.3-p194
,ruby-2.0.0-p247
和ruby-2.2.1
。