"Unable to require openssl" is driving me crazy gem 2.0.3 might be broken

Hello Team,

I was having lost of problems when Ruby *gem *stop working. So I
upgraded
from Ruby
1.9.3-p392http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/upgraded
to Ruby
1.9.3-p429http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/mistakenly
thinking that my problems would be over. The is related to
openssl, which I tried to install with gem but gem is broken.

I searched and searched for a while trying to locate the openssl library
needed to install it without using gem, but I could not find it.

The installation process for Ruby
1.9.3-p42http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/,
(./configure, make, make install) went just fine without error.

This is what I have:

OS:
RedHat (RHEL) 6.3, x86_64-linux
http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/

ruby -v
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]

gem -v
2.0.3

If I do a gem list, it works fine displaying the local installed gems.

If I tried to download a gem or upgrade gem itself, it fails. Anything
that
requires to reach out outside my server, it fails.

For example,

gem list --remote

*** REMOTE GEMS ***

ERROR: While executing gem … (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby
(preferred)
or use non-HTTPS sources

or

gem install --sinatra
ERROR: Loading command: install (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass

or

gem server
ERROR: Loading command: server (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass

Any help will be appreciated.

Thank you

I neglected to show my current OpenSSL installed files:

rpm -qa | grep -i openssl

openssl-perl-1.0.0-25.el6_3.1.x86_64
openssl-1.0.0-25.el6_3.1.x86_64
openssl-devel-1.0.0-25.el6_3.1.x86_64
openssl-1.0.0-25.el6_3.1.i686
openssl-static-1.0.0-25.el6_3.1.x86_64
openssl098e-0.9.8e-17.el6_2.2.x86_64

and

yum list | grep -i openssl

openssl.i686 1.0.0-25.el6_3.1
@RHEL-63-x86_64-updates
openssl.x86_64 1.0.0-25.el6_3.1
@RHEL-63-x86_64-updates
openssl-devel.x86_64 1.0.0-25.el6_3.1
@RHEL-63-x86_64-updates
openssl-perl.x86_64 1.0.0-25.el6_3.1
@RHEL-63-x86_64-updates
openssl-static.x86_64 1.0.0-25.el6_3.1
@RHEL-63-x86_64-updates
openssl098e.x86_64 0.9.8e-17.el6_2.2
@el63/$releasever
globus-gsi-openssl-error.i686 2.1-2.el6
epel
globus-gsi-openssl-error.x86_64 2.1-2.el6
epel
globus-gsi-openssl-error-debuginfo.x86_64
globus-gsi-openssl-error-devel.i686 2.1-2.el6
epel
globus-gsi-openssl-error-devel.x86_64 2.1-2.el6
epel
globus-gsi-openssl-error-doc.noarch 2.1-2.el6
epel
globus-openssl-module.i686 3.2-1.el6
epel
globus-openssl-module.x86_64 3.2-1.el6
epel
globus-openssl-module-debuginfo.x86_64 3.2-1.el6
epel-debuginfo
globus-openssl-module-devel.i686 3.2-1.el6
epel
globus-openssl-module-devel.x86_64 3.2-1.el6
epel
globus-openssl-module-doc.noarch 3.2-1.el6
epel
globus-openssl-module-progs.x86_64 3.2-1.el6
epel
krb5-pkinit-openssl.x86_64 1.9-33.el6_3.3
RHEL-63-x86_64-updates
libpathfinder-openssl.x86_64 1.1.0-1.el6
occ-auto
libpathfinder-openssl-devel.x86_64 1.1.0-1.el6
occ-auto
mingw32-openssl.noarch 1.0.0d-2.el6
occ-auto
mingw32-openssl-static.noarch 1.0.0d-2.el6
occ-auto
mingw64-openssl.noarch 1.0.0d-2.el6
occ-auto
mingw64-openssl-static.noarch 1.0.0d-2.el6
occ-auto
openssl-devel.i686 1.0.0-25.el6_3.1
RHEL-63-x86_64-updates
openssl098e.i686 0.9.8e-17.el6_2.2
RHEL-63-x86_64
perl-Crypt-OpenSSL-AES.x86_64 0.02-9.el6
epel
perl-Crypt-OpenSSL-AES-debuginfo.x86_64
perl-Crypt-OpenSSL-Bignum.x86_64 0.04-8.1.el6
RHEL-63-x86_64
perl-Crypt-OpenSSL-DSA.x86_64 0.13-14.el6
epel
perl-Crypt-OpenSSL-DSA-debuginfo.x86_64
perl-Crypt-OpenSSL-PKCS10.x86_64 0.06-13.el6
occ-auto
perl-Crypt-OpenSSL-RSA.x86_64 0.25-10.1.el6
RHEL-63-x86_64
perl-Crypt-OpenSSL-Random.x86_64 0.04-9.1.el6
RHEL-63-x86_64
perl-Crypt-OpenSSL-X509.x86_64 1.800.2-1.el6
epel
perl-Crypt-OpenSSL-X509-debuginfo.x86_64
pyOpenSSL.x86_64 0.10-2.el6
RHEL-63-x86_64
xmlsec1-openssl.i686 1.2.16-2.el6
epel
xmlsec1-openssl.x86_64 1.2.16-2.el6
epel
xmlsec1-openssl-devel.i686 1.2.16-2.el6
epel
xmlsec1-openssl-devel.x86_64 1.2.16-2.el6 epel

On 06/09/2013 03:17 PM, Ruby S. wrote:

I searched and searched for a while trying to locate the openssl library
http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/
that requires to reach out outside my server, it fails.

For example,

gem list --remote

*** REMOTE GEMS ***

ERROR: While executing gem … (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby
(preferred) or use non-HTTPS sources

You probably need to install the openssl development package and then
recompile Ruby. It should be called something like “openssl-devel”.

If you use RVM it would probably take care of this for you:
https://rvm.io/rvm/autolibs/

-Justin

I already have the openssl development package. I recompiled and got the
same errors.

rpm -qa | grep -i openssl

openssl-perl-1.0.0-25.el6_3.1.
x86_64
openssl-1.0.0-25.el6_3.1.x86_64
openssl-devel-1.0.0-25.el6_3.1.x86_64
openssl-1.0.0-25.el6_3.1.i686
openssl-static-1.0.0-25.el6_3.1.x86_64
openssl098e-0.9.8e-17.el6_2.2.x86_64

On 06/09/2013 04:31 PM, Ruby S. wrote:
On Sun, Jun 9, 2013 at 6:38 PM, Justin C. <[email protected]

mailto:[email protected]> wrote:

On 06/09/2013 03:17 PM, Ruby S. wrote:

    Hello Team,

    I was having lost of problems when Ruby *gem *stop working. 

So I

    upgraded from Ruby 1.9.3-p392

<http://www.ruby-lang.org/en/__news/2013/02/22/ruby-1-9-3-__p392-is-released/

http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/>

    upgraded to Ruby 1.9.3-p429

<http://www.ruby-lang.org/en/__news/2013/02/22/ruby-1-9-3-__p392-is-released/

http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/>

    mistakenly thinking that my problems would be over. The is
    related to
    openssl, which I tried to install with gem but gem is broken.

    I searched and searched for a while trying to locate the 

openssl

    library
    needed to install it without using gem, but I could not find 

it.

    The installation process for Ruby 1.9.3-p42

<http://www.ruby-lang.org/en/__news/2013/02/22/ruby-1-9-3-__p392-is-released/

http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/>,

    (*./configure, make, make install*) went just fine without 

error.

    This is what I have:

    OS:
    RedHat (RHEL) 6.3, x86_64-linux

<http://www.ruby-lang.org/en/__news/2013/02/22/ruby-1-9-3-__p392-is-released/

http://www.ruby-lang.org/en/news/2013/02/22/ruby-1-9-3-p392-is-released/>

    *ruby -v*

    ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]

    *gem -v*
    2.0.3

    If I do a *gem list*, it works fine displaying the local
    installed gems.


    If I tried to download a gem or upgrade gem itself, it fails.
    Anything
    that requires to reach out outside my server, it fails.

    For example,

    *gem list --remote*


    *** REMOTE GEMS ***

    ERROR:  While executing gem ... (Gem::Exception)
          Unable to require openssl, install OpenSSL and rebuild 

ruby

    (preferred) or use non-HTTPS sources


<snip>

You probably need to install the openssl development package and
then recompile Ruby. It should be called something like

“openssl-devel”.

If you use RVM it would probably take care of this for you:
https://rvm.io/rvm/autolibs/

-Justin


Ruby S.

openssl-static-1.0.0-25.el6_3.1.x86_64
openssl098e-0.9.8e-17.el6_2.2.x86_64

If you go to the ext/openssl/ directory in the Ruby source code and run
“ruby extconf.rb” does it succeed?

-Justin

As suggested by Justin, I installed and used rvm and it worked like a
charm!

Thank you