OpenSSL error installing Ruby 2.1.x and 2.3.x on Archlinux with ruby-install / ruby-build

I'm having trouble creating older versions of Ruby from ruby-install on Archlinux. I suspect the same thing is happening with ruby-build. I see the following after trying to install Ruby 2.1.5, 2.1.6, 2.3.0, 2.3.1, 2.3.4.

/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." 

or

 ossl_ssl.c:465:38: error: 'CRYPTO_LOCK_SSL_SESSION' undeclared 
+5
source share
1 answer

If you have not installed it yet, you need to open SSL 1.0:

 pacman -S openssl-1.0 

To install Ruby 2.3.x, you need the following:

 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install ruby 2.3.0 

I installed 2.3.0, 2.3.1 and 2.3.4 this way.

I am using ruby-install , but the same applies to ruby-build ( rbenv ).

For Ruby 2.1.x and 2.2.x, a patch is required:

 curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt > ruby2.x-openssl.patch PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install -p ruby2.x-openssl.patch ruby 2.1.5 

I installed 2.1.5 and 2.1.6 in this way.

For older versions of Ruby (<2), another patch may be required, which can be downloaded here:

https://github.com/rbenv/ruby-build/wiki#openssl-sslv3_method-undeclared-error

Corrupted memory and Segfaults when compiling ruby

If you get segfaults when compiling, it may be due to the latest version of gcc. The workaround is to install an older version, and then specify it for ruby-install:

 sudo pacman -S gcc5 CC=/usr/sbin/gcc-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig ruby-install ruby 2.3.0 

Link: https://github.com/rbenv/ruby-build/issues/1092

+15
source

Source: https://habr.com/ru/post/1268105/


All Articles