I am working in a project where the openssl (2.2.1) gem is used and ruby 2.7.5 is used. I successfully installed Ruby 2.7.5 with rbenv (ruby-build helped install it by downloading openssl 1.1.1).
However, when I do bundle install, I get the following error:
extconf.rb:113:in `<main>': OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required (RuntimeError)
...
An error occurred while installing openssl (2.2.1), and Bundler cannot continue.
Make sure that `gem install openssl -v '2.2.1' --source 'https://rubygems.org/'` succeeds before bundling
I tried installing the gem manually by doing this: gem install openssl -v '2.2.1' -- --with-openssl-dir=$(brew --prefix [email protected]) but this didn't work. I don't know what else to do. The command brew --prefix [email protected] returns /opt/homebrew/opt/[email protected] but looks like it is using the other openssl version I have installed which is the one I get if I do openssl version (this returns OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023)).
I tried installing the gem with gem install openssl -v '2.2.1' -- --with-openssl-dir=$(brew --prefix [email protected]) and expected that the gem will be installed with the openssl dir specified
For install gem openssl v2, install [email protected] first.
Set ENV
export PKG_CONFIG_PATH=$(brew --prefix [email protected])/lib/pkgconfig, then executegem install openssl -v 2.1.2 -- --with-openssl-dir="$(brew --prefix [email protected])".Or simply execute command:
PKG_CONFIG_PATH=$(brew --prefix [email protected])/lib/pkgconfig gem install openssl -v 2.1.2 -- --with-openssl-dir="$(brew --prefix [email protected])".Please replace openssl version 2.1.2 to your version.