troubles with RVM and OpenSSL
It's well described on ArchLinux wiki:
Ruby versions older than 2.4 require OpenSSL 1.0 but RVM will try to build them with OpenSSL 1.1.
So you can do (easiest):
$ rvm pkg install openssl$ rvm reinstall 2.3.5 --with-openssl-dir=$HOME/.rvm/usr
You can see more solutions on ArchLinux wiki.