2
votes

I'm getting

ERROR:  While executing gem ... (NameError) uninitialized constant Gem::RemoteFetcher::OpenSSL

When I try to run

# gem install rails
I already have
  • Ruby v1.8.7
  • Gem (rubygems.nonarch) v1.7.2

Installed.

Any Idea what I should do?


Running sudo gem install rails now gives me:

ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.7.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.7.4/ext/json/ext/generator/gem_make.out


Everything Installed via YUM

Running Fedora 15

3
Thanks for the advice. I haven't asked very many questions yet, and I'm still waiting for a satisfactory answer on some. But I'll go back and check If I missed anything anyway. :)ffledgling

3 Answers

5
votes

I was having a similar issue while doing #gem install rake, but I found out that my system was behind a proxy server, and so I tried supplying the proxy address by this command:

gem install rake -p http//IPaddress:proxyport (put : after http)  

and it worked for me, with no such error afterwards.

0
votes

Hit rvm requirements. You don't have libssl-dev installed.

➜  ~  rvm requirements

Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10" )

NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
             This is the *original* / standard Ruby Language Interpreter
      'ree'  represents Ruby Enterprise Edition
      'rbx'  represents Rubinius

bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).

To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

# For JRuby, install the following:
  jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
  jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

# For IronRuby, install the following:
  ironruby: /usr/bin/apt-get install curl mono-2.0-devel

I'm not aware how Fedora's requirements differ from Ubuntu's, but that's probably only in package names.

0
votes

I have just had same issue with gem install on Ubuntu. It is now working and I think that what I did to fix it was enable ssl out through the firewall.

It looks as if gem returns this error in response to failure to establish an SSL connection, presumably while trying to handle the failure.

Russell