Sorting out why the openssl v3.0.1 RubyGem wouldn't work on OpenBSD was a hellish job. The --with-openssl-dir option didn't work, because it expected a Linux path. Aaarrrgghhh!

The repo version (3.1.0.pre) fixes it. Took me way too long to discover that.

$ gem install specific_install
$ gem specific_install -l https://github.com/ruby/openssl.git

Compiles against LibreSSL without any issue. Grab a cup of coffee and patiently await the gem succesfully compiling.

Comparing v2.1.3...v2.1.4 · ruby/openssl

Provides SSL, TLS and general purpose cryptography. - Comparing v2.1.3...v2.1.4 · ruby/openssl

GitHub