Last Updated: August 02, 2022
· dinks

Monterey install Ruby 2.3.1

It seems like installing Ruby 2.3.1 on the new Monterey 12.2.1 is not that easy. This is because of the compilation issues of OpenSSL 1.0.2.

Its just says

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [link_a.darwin] Error 1
make[3]: *** [do_darwin-shared] Error 2

and then brew does not support 1.0..

After some digging I stumbled upon
In short do

curl -LO
brew install --formula --build-from-source ./openssl@1.0.rb
rm ./openssl@1.0.rb

then do brew list openssl@1.0 to get the actual installation location
and then

RUBY_CONFIGURE_OPTS=--with-openssl-dir=<location> rbenv install 2.3.1

I hope this helps someone!