Ruby 2.7 with RVM on Debian Trixie
If you need to install ruby 2.7 with RVM on Debian Trixie (to maintain old systems that have not yet been migrated to newer versions of Ruby) then you can proceed as follows.
First install RVM and dependencies as you are used to doing it.
Then let's instruct RVM to be able to rapatriate an old version of OpenSSL (Debian 13 Trixie incorporates OpenSSL 3.5.1, this version is too recent for compiling Ruby 2.7.x)
echo "openssl_version=1.1.1w" >> ~/.rvm/user/db
Open ~/.rvm/scripts/functions/pkg and remove "no-krb5" in the following line
configure+=( -I$rvm_usr_path/include -L$rvm_usr_path/lib zlib "${openssl_use_asm[@]}" no-krb5 )
which becomes
configure+=( -I$rvm_usr_path/include -L$rvm_usr_path/lib zlib "${openssl_use_asm[@]}")
Then ask RVM to retrieve the SSL version we asked:
rvm pkg install openssl
You can now install Ruby 2.7.x using this OpenSSL version rather than the system lib:
rvm install 2.7.4 --with-openssl-dir=~/.rvm/usr