2
votes

I am trying to install ruby 2.2.3, previously I have installed ruby 2.2.2,

rbenv versions
system  
* 2.2.2 (set by /home/emen/.ruby-version)
jruby-1.7.20
jruby-9.0.0.0.pre2Build

I got a problem when tried to install Ruby 2.2.3, got build failed below :

rbenv install 2.2.3  
Downloading ruby-2.2.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.bz2 Installing ruby-2.2.3...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20160111-27-g06f1254)

Inspect or clean up the working tree at /tmp/ruby-build.20160127112741.26444 Results logged to /tmp/ruby-build.20160127112741.26444.log

I have inspected log, just copy a part of suspect since another checking and compiling process were fine :

linking shared-object objspace.so
make[2]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/objspace'
compiling ossl_ssl.c
make[2]: Entering directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/pathname'
compiling pathname.c
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]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
installing default pathname libraries
linking shared-object date_core.so
make[2]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/date'
linking shared-object pathname.so
make[2]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/pathname'
linking shared-object nkf.so
make[2]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3/ext/nkf'
make[1]: Leaving directory `/tmp/ruby-build.20160127112741.26444/ruby-2.2.3'
make: *** [build-ext] Error 2

I have tried to follow this rbenv install ruby BUILD FAILED

I have run this :

sudo apt-get install libffi-dev

or

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

and

curl -fsSL https://gist.github.com/ekr1/7313abef4348daa038dd.txt | rbenv install --patch 2.2.3

but still no luck, I might miss something, appreciating your help. Thanks!

2

2 Answers

6
votes

I have fixed this build failed by patching from https://gist.github.com/mislav/055441129184a1512bb5/

executed this :

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

1
votes

this looks like an openssl problem. The SSL_v3 not defined means that you don't have it or you have an older library.

Try:

rvm pkg install openssl
rvm install 2.2.3 --with-openssl-dir=$HOME/.rvm/usr