ERROR: While executing gem ... (Gem::Exception)
OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
is triggered when try to install a gem.
The system already have openssl and the libssl-dev installed.
Openssll version: OpenSSL 1.1.1f 31 Mar 2020.
OS: LinxMint 20.3.
Did you reinstall Ruby after installing openssl/libssl-dev? If so, how did you install Ruby? Can you post the configure environment and args, and upload the build log (output of configure/make) and ext/openssl/mkmf.log?
Did you reinstall Ruby after installing openssl/libssl-dev? If so, how did you install Ruby? Can you post the configure environment and args, and upload the build log (output of configure/make) and ext/openssl/mkmf.log?
When I installed Ruby, my system already have the openssl. However, I tried to reinstall Ruby with the commands:
./configure --with-openssl-dir=/usr/bin/openssl
sudo make
sudo make install
/opt/ruby-3.1.1/ext/openssl/extconf.rb:100: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
I see you attempted to specify it in the configure argument. However, it seems unlikely that /usr/bin/openssl is a directory. You may want to use --with-openssl-include=/path/to/openssl/headers --with-openssl-lib=/path/to/openssl/lib, with values appropriate to your installation.
You may want to use --with-openssl-include=/path/to/openssl/headers --with-openssl-lib=/path/to/openssl/lib, with values appropriate to your installation.
but it didn't work.
After read the code at /opt/ruby-3.1.1/ext/openssl/extconf.rb I ran the irb and tested the headers("openssl/ssl.h") and the pkg_config("openssl") and it both returns true; so it appears that the openssl and its libs and paths is ok.
So, I decided to uninstall the ruby and install it again, with one difference: at this time I installed without sudo (in the first time I tried install it with sudo at /opt/ruby-3.1.1) at ~/Downloads/ruby-3.1.1, and it works! Now I have openssl support.
But, unfortunately, I got another error as follow:
After installed the gem rubygems-server I try the "gem server" command and the follow error is returned:
ERROR: Loading command: server (NameError)
uninitialized constant Gem::Commands::ServerCommand::OptionParser
OptionParser.accept :Port do |port|
^^^^^^^^^^^^
ERROR: While executing gem ... (NoMethodError)
undefined method `deprecated?' for nil:NilClass
cmd.deprecation_warning if cmd.deprecated?
^^^^^^^^^^^^
Should I report another bug? Maybe with another description...
But, unfortunately, I got another error as follow:
After installed the gem rubygems-server I try the "gem server" command and the follow error is returned:
ERROR: Loading command: server (NameError)
uninitialized constant Gem::Commands::ServerCommand::OptionParser
OptionParser.accept :Port do |port|
^^^^^^^^^^^^
ERROR: While executing gem ... (NoMethodError)
undefined method `deprecated?' for nil:NilClass
cmd.deprecation_warning if cmd.deprecated?
^^^^^^^^^^^^
Should I report another bug? Maybe with another description...