Usually you can install Ruby with rbenv and ruby-build for Ubuntu. However, I needed to install older Ruby (2.3.7) and got an error.
rbenv install 2.3.7 stops with "Failed to configure openssl. It will not be installed." , even I've installed libssl-dev package.
On Ubuntu 18.04,
libssl-dev is openssl 1.1.0, which is not compatible with Ruby 2.3.
- download openssl-1.0.2o.tar.gz https://www.openssl.org/source/
CONFIGURE_OPTS='--with-openssl-dir=/home/yhara/bin/openssl-1.0.2o' rbenv install 2.3.7