Update to current ruby versions on Manjaro Linux when using RVM and no precompiled binary is available.
sudo pacman -S gcc openssl-1.1
Replace Ruby version at the end of this command with the version you want to install.
CC=gcc CXX=g++ PKG_CONFIG_PATH=/usr/lib/openssl-1.1/pkgconfig/:/usr/lib/pkgconfig/ RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/lib/openssl-1.1 rvm install 3.0.6
thanks!!