Here is a set of commands i ran to get ruby 3.2.2 installed on my macbook with m2 chip.
which openssl
# /Users/razvan/miniforge3/bin/openssl
rvm reinstall "ruby-3.2.2" --with-openssl-dir=/Users/razvan/miniforge3/bin/openssl
I tried installing openssl like this:
rvm pkg install openssl
But it didn't work. I had to use the path to the openssl that was installed with miniforge3. The rvm pkg command installs openssl 1.0 and ruby 3.2.2 requires a bigger version.