I have freshly installed Mint 19(Tara) and was trying to install Ruby 2.3.8 using rbenv and got this error.Can anyone help me with this?
$ rbenv install 2.3.8 1 ↵
Downloading ruby-2.3.8.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2
Installing ruby-2.3.8...
WARNING: ruby-2.3.8 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
BUILD FAILED (LinuxMint 19 using ruby-build 20200401-11-g12af1c3)
Inspect or clean up the working tree at /tmp/ruby-build.20200519084931.6743.ptWQ7b
Results logged to /tmp/ruby-build.20200519084931.6743.log
Last 10 log lines:
../../internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
linking shared-object json/ext/generator.so
make[2]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/json/generator'
linking shared-object objspace.so
make[2]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/objspace'
linking shared-object nkf.so
make[2]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8/ext/nkf'
make[1]: Leaving directory '/tmp/ruby-build.20200519084931.6743.ptWQ7b/ruby-2.3.8'
uncommon.mk:203: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
It seems the issue is not with
rbenvbut with other version managers likechrubyandasdfalso. The real problem is compatibility issue with openssl and ruby 2.3.x.The openssl extension of Ruby version before 2.4 is not compatible with OpenSSL 1.1.x. At the moment, most Linux distributions that come with OpenSSL 1.1.0 have a separate package for OpenSSL 1.0.x.
You need to install the earlier version of OpenSSL or use ruby 2.4.x.
This solved my issue.
Note:
libgdbm5for Ubuntu19 or Mint19 andlibgdbm6for later versions.for
MacOS and Home brewsee https://github.com/rbenv/ruby-build/wiki#openssl-version-compatibility