You are not logged in.

#1 2016-03-10 15:22:39

shelbydz
Member
Registered: 2014-03-16
Posts: 58

[solved] ruby install issues - openssl and libreadline

This post is more for informational purposes for the Arch community. I couldn't find any good documentation and had to hack it all together to get it working. So, hello future people. Enjoy.

tl;dr; - always install rbenv and ruby-install from AUR, you'll probably need to custom patch to get around the openssl issue

The issue: I needed to install a specific version of ruby, I also needed rbenv installed to manage environments. I had a ton of errors with the git versions and Arch, mostly related to not finding the libreadline.so. Even passing the --with-readline-dir option didn't fix it. There was also a problem with the openssl library version.

The solution:
Eventually, I removed the git versions of rbenv and ruby-install then installed both from the AUR. This, and the dependencies from the rbenv wiki https://github.com/rbenv/ruby-build/wiki fixed the libreadline problem.

The wiki also mentions the openssl issue but the referenced patch didn't work. The verbose output said that it failed on line 104 of ext/openssl/extconf.rb. Comparing the patch (located at https://gist.githubusercontent.com/misl … 512bb5/raw) to the extconf.rb (in the /tmp/ruby-build.XXXXX dir) showed that the SURROUNDING lines were wrong. Not the lines to be patched.

I copied the patch locally, edited it to match the target file:
from

 have_func("SSLv2_method")
 have_func("SSLv2_server_method")
 have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
+have_func("SSLv3_client_method")
 have_func("TLSv1_1_method")
 have_func("TLSv1_1_server_method")
 have_func("TLSv1_1_client_method")

to

  have_func("SSLv2_method")
  have_func("SSLv2_server_method")
  have_func("SSLv2_client_method")
  +have_func("SSLv3_method")
  +have_func("SSLv3_server_method")
  +have_func("SSLv3_client_method")
  unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
  have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TL109")
   end

(where the last 3 lines came from a local copy of /tmp/ruby-build.XXXXXX/ruby-1.9.3p448/ext/openssl/extconf.rb, lines 108-110 after a failed build)
then patched the file with the local copy:

cat openssl.patch | rbenv install -v --patch 1.9.3-p448

Offline

#2 2016-04-04 12:32:36

dmccombs
Member
Registered: 2016-03-19
Posts: 2

Re: [solved] ruby install issues - openssl and libreadline

Just ran into this and worked around it with the info you posted. Thanks for taking the time to write it up!

-Dan

Offline

#3 2016-11-26 09:32:42

FiveYellowMice
Member
Registered: 2016-11-26
Posts: 3

Re: [solved] ruby install issues - openssl and libreadline

Just created a Gist from this post, also corrected the indentaion error in the post.

https://gist.github.com/FiveYellowMice/ … c9fc3bf6cf

Which means you can also do

curl -fsSL https://gist.github.com/FiveYellowMice/c50490693d47577cfe7e6ac9fc3bf6cf.txt | rbenv install --patch 1.9.3-p551

which does the same thing, but simpler.

Offline

Board footer

Powered by FluxBB