Installing Ruby 2.3.x on Ubuntu 18.04 is causing an error by the end of the installation process Installing Ruby 2.3.x on Ubuntu 18.04 is causing an error by the end of the installation process ruby ruby

Installing Ruby 2.3.x on Ubuntu 18.04 is causing an error by the end of the installation process


I had a same issue, though it seemed problem was in gcc, in my case problem was in libssl-dev, this is what helped me:

sudo apt purge libssl-dev && sudo apt install libssl1.0-dev

I use rbenv. If you use rvm, you might hit problem after running previous command:

/usr/share/rvm/scripts/base: No such file or directory

I recommend trying rbenv. After installing libssl1.0-dev, everything was flawless.


cd ~/src wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz tar xvzf openssl-1.0.2s.tar.gz cd openssl-1.0.2s mkdir ~/.rubies/openssl-1.0.2s ./config --prefix=$HOME/.rubies/openssl-1.0.2s --shared make make install RUBY_CONFIGURE_OPTS=--with-openssl-dir=$HOME/.rubies/openssl-1.0.2s rbenv install 2.3.1

worked for me


Got it working also with RVM:

1. sudo apt purge libssl-dev && sudo apt install libssl1.0-dev2. rvm install 2.3.5 --autolibs=disable

You must install RVM dependencies manually, otherwise, with autolibs enabled, RVM will try to update system dependencies and also libssl-dev (that you downgraded in the first step). If you don't want to manually install dependencies you can try to install Ruby with autolibs enabled, the installation will fail, at this point you have dependencies installalled, so you can downgrade libssl repeating all from step 1.