Project

General

Profile

Actions

Bug #18602

closed

OpenSSL is not available.

Added by t3rcio (Tercio Oliveira) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:107739]

Description

The following exception:

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.


Files

out_configure_ruby311.txt (28.2 KB) out_configure_ruby311.txt configure log t3rcio (Tercio Oliveira), 02/25/2022 12:32 PM
mkmf.log (12.9 KB) mkmf.log mkmf.log t3rcio (Tercio Oliveira), 02/25/2022 12:35 PM
make.out (8.72 KB) make.out make.out t3rcio (Tercio Oliveira), 02/25/2022 12:40 PM

Updated by jeremyevans0 (Jeremy Evans) over 2 years ago

  • Status changed from Open to Feedback

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?

Updated by t3rcio (Tercio Oliveira) over 2 years ago

jeremyevans0 (Jeremy Evans) wrote in #note-1:

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

Updated by jeremyevans0 (Jeremy Evans) over 2 years ago

From your mkmf.log:

/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.

Updated by t3rcio (Tercio Oliveira) over 2 years ago

I tried your suggestion:

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...

Updated by jeremyevans0 (Jeremy Evans) over 2 years ago

  • Status changed from Feedback to Closed

t3rcio (Tercio Oliveira) wrote in #note-4:

Now I have openssl support.

Great! So this issue can be closed.

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...

If you were going to report the bug, you would report it to the rubygems-server project. I checked and the bug has already been reported there: https://github.com/rubygems/rubygems-server/issues/1

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0