Ruby 2.3.x requires the OpenSSL library version 1.0.x, however this version of the library has been deprecated for a while.
If you're using homebrew the library is no longer a Formula since the end of 2019, so you'll need a work-around to be able to install it. As the new openssl formula in homebrew-core is versioned, you can search for the old formula and extract it into any of your existing taps (we'll use homebrew/cask for simplicity, as most people have it installed).
# First extract the last existing version of the openssl unversioned formula into an existing tap
brew extract openssl homebrew/cask
# Then install the extracted formula
brew install [email protected]
After that you'll able to compile ruby 2.3.x by passing the path of the OpenSSL 1.0.2t library to the compiler (or to RVM as in the following example)
rvm reinstall --disable-binary ruby-2.3.7 --with-openssl-dir="/usr/local/opt/[email protected]"
There is a reason why OpenSSL v1.0 is no longer in use, and as a general rule you should never install deprecated cryptography libraries. However, if you're working with legacy software and you can't update the dependencies to a newer version, now you know how to do it.