Go through this link https://github.com/rvm/rvm/issues/5507
curl -sSL https://github.com/ruby/ruby/commit/1dfe75b0beb7171b8154ff0856d5149be0207724.patch -o ruby-307-fix.patch && rvm install 3.0.7 --patch ruby-307-fix.patch --with-openssl-dir=$(brew --prefix [email protected]) && rm ruby-307-fix.patch;
The above command worked for me.