ruby-build: Cannot install Ruby 2.2.3 in ubuntu 14.04

Hi,

I am getting below error while installing Ruby 2.2.3 in fresh ubuntu install.

ossl_ssl.c:141:27: error: ‘SSLv3_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3),
                           ^
ossl_ssl.c:119: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:142:27: error: ‘SSLv3_server_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3_server),
                           ^
ossl_ssl.c:119: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:143:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3_client),
                           ^
ossl_ssl.c:119:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
make[2]: Leaving directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3/ext/date'
make[2]: Entering directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3/ext/sdbm'
compiling _sdbm.c
make[2]: *** [ossl_ssl.o] Error 1
make[2]: *** Waiting for unfinished jobs....
compiling init.c
make[2]: Leaving directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default ripper libraries
linking shared-object sdbm.so
make[2]: Leaving directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3/ext/sdbm'
linking shared-object ripper.so
make[2]: Leaving directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3/ext/ripper'
make[1]: Leaving directory `/tmp/ruby-build.20151124103608.7950/ruby-2.2.3'
make: *** [build-ext] Error 2

Thank you

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 37 (7 by maintainers)

Most upvoted comments

Using Ubuntu 18 here, solved doing this:

sudo apt install libssl1.0-dev
rbenv install 2.2.2

The problem is that this ruby version uses an old version of libssl (1.0) and the default package for Ubuntu is libssl 1.1.0

Could everyone who’s having this problem try this patch as a workaround?

curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3

Thanks!

@jatindhankhar: I ran into the same problem on Archlinux.

The problem is that ruby < 2.4 tries to use the system default OpenSSL, which then fails with:

compiling ossl_pkcs7.c
In file included from ossl.h:57:0,
                  from ossl_pkcs7.c:10:
/usr/include/openssl/asn1_mac.h:10:2: error: #error "This file is obsolete; please update your software."
#error "This file is obsolete; please update your software."

The workaround for that is to force ruby to use OpenSSL 1.0 suggested in the Archlinux wiki for rvm, but the same thing works for rbenv:

sudo pacman -S openssl-1.0 # Probably already installed
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig:/usr/lib/pkgconfig rbenv install 2.2.4

Same issue here with Debian Strech.

I know this thread is a little old, but I wanted to chime in and say I was having the same problem on Arch and that the patch above fixed it. Cheers!

Ubuntu 19 does not include libssl1.0-dev in the standard repositories. I solved this by adding the cosmic security repository as per: https://packages.ubuntu.com/cosmic/amd64/libssl1.0.0/download

Add this line to /etc/apt/sources.list: deb http://security.ubuntu.com/ubuntu cosmic-security main

Then run

sudo apt update
sudo apt install libssl1.0-dev
rbenv install 2.2.3

I’m working with a fresh, up-to-date install of Arch and, despite trying @mislav’s patch and others and several ruby versions, continue to get the SSLv3 error in all cases:

curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3

yields:

installing bundle gems: /home/lbrown/.linuxbrew/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0 (build_info, cach e, doc, extensions, gems, specifications) /tmp/ruby-build.20160915151644.17700/ruby-2.2.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require’: /tmp/ruby-b uild.20160915151644.17700/ruby-2.2.3/.ext/x86_64-linux/openssl.so: undefined symbol: SSLv3_method - /tmp/ruby-build. 20160915151644.17700/ruby-2.2.3/.ext/x86_64-linux/openssl.so (LoadError)

What might you folks suggest?