# Fails to require OpenSSL

**URL:** <https://rubytalk.org/t/fails-to-require-openssl/70601>\
**Category:** ruby-talk\
**Created:** [27 February 2015 19:19 UTC](https://rubytalk.org/t/fails-to-require-openssl/70601 "2015-02-27T19:19:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himel\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Himel\_Sarkar](https://rubytalk.org/u/Himel_Sarkar)\
**Post date:** [27 February 2015 19:19 UTC](https://rubytalk.org/t/fails-to-require-openssl/70601/1 "2015-02-27T19:19:20Z")

</div>

Hey! So I had a little bit of a problem!

I'm running Ruby 2.2 with Rails 2.3. I'm trying upgrade rails to advances  
versions. But everytime I run gem install rails. this happens.

himel@ubuntu:~/Downloads/Rubynew/ruby-2.2.0$ sudo gem install rails  
Building native extensions. This could take a while...  
ERROR: Error installing rails:  
&nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.

&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/ruby -r ./siteconf20150228-25704-26oogh.rb extconf.rb  
checking if the C compiler accepts ... yes  
Building nokogiri using packaged libraries.  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of necessary  
libraries and/or headers. Check the mkmf.log file for more details. You  
may  
need configuration options.

Provided configuration options:  
&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-dir  
&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-dir  
&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-include  
&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-include=${opt-dir}/include  
&nbsp;&nbsp;&nbsp;&nbsp;--with-opt-lib  
&nbsp;&nbsp;&nbsp;&nbsp;--without-opt-lib=${opt-dir}/lib  
&nbsp;&nbsp;&nbsp;&nbsp;--with-make-prog  
&nbsp;&nbsp;&nbsp;&nbsp;--without-make-prog  
&nbsp;&nbsp;&nbsp;&nbsp;--srcdir=.  
&nbsp;&nbsp;&nbsp;&nbsp;--curdir  
&nbsp;&nbsp;&nbsp;&nbsp;--ruby=/usr/local/bin/$(RUBY\_BASE\_NAME)  
&nbsp;&nbsp;&nbsp;&nbsp;--help  
&nbsp;&nbsp;&nbsp;&nbsp;--clean  
&nbsp;&nbsp;&nbsp;&nbsp;--use-system-libraries  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
`require': cannot load such file -- openssl (LoadError)  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/ruby/2.2.0/net/https.rb:22:in `\<top (required)\>'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/gems/2.2.0/gems/mini\_portile-0.6.2/lib/mini\_portile.rb:3:in  
`\<top (required)\>'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
`rescue in require'  
&nbsp;&nbsp;&nbsp;&nbsp;from  
/usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:39:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;from extconf.rb:395:in `\<main\>'

extconf failed, exit code 1

Gem files will remain installed in  
/usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.  
Results logged to  
/usr/local/lib/ruby/gems/2.2.0/extensions/x86\_64-linux/2.2.0-static/nokogiri-1.6.6.2/gem\_make.out

\*The other problem is that Ruby is failing to require openSSL whereas it is  
already installed in the computer. I'm changed the Ruby gem sources to  
[http://rubygems.org](http://rubygems.org) instead of the https:// version.  
I've rebuilt Ruby multiple times. Can someone help me out? I'm really stuck  
here and don't know what to do. \*

> **···**
>
> --  
> Himel Sarkar,  
> \*[himelsarkarforever.blogspot.com](http://himelsarkarforever.blogspot.com) \<[http://himelsarkarforever.blogspot.com](http://himelsarkarforever.blogspot.com)\>\*
> 
> \* Here's to the crazy ones. The misfits. The rebels. The troublemakers. The  
> round pegs in the square holes. The ones who see things differently.  
> They're not fond of rules. And they have no respect for the status quo. You  
> can quote them, disagree with them, glorify or vilify them. About the only  
> thing you can't do is ignore them. Because they change things. They push  
> the human race forward. And while some may see them as the crazy ones, we  
> see genius. Because the people who are crazy enough to think they can  
> change the world are the ones who do.\*

---

<div class="post-metadata">

**Author:** ![Eugeniu\_T](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/eugeniu_t/32/1947_2.png) [@Eugeniu\_T](https://rubytalk.org/u/Eugeniu_T)\
**Post date:** [27 February 2015 20:05 UTC](https://rubytalk.org/t/fails-to-require-openssl/70601/2 "2015-02-27T20:05:44Z")

</div>

Hi, if you have mac you need to isntall xcode, after it launch this  
command: xcode-select --install

> **···**
>
> 2015-02-27 20:19 GMT+01:00 Himel Sarkar \<hsarkar.007@gmail.com\>:
> 
> > Hey! So I had a little bit of a problem!
> > 
> > I'm running Ruby 2.2 with Rails 2.3. I'm trying upgrade rails to advances  
> > versions. But everytime I run gem install rails. this happens.
> > 
> > himel@ubuntu:~/Downloads/Rubynew/ruby-2.2.0$ sudo gem install rails  
> > Building native extensions. This could take a while...  
> > ERROR: Error installing rails:  
> > &nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/ruby -r ./siteconf20150228-25704-26oogh.rb extconf.rb  
> > checking if the C compiler accepts ... yes  
> > Building nokogiri using packaged libraries.  
> > \*\*\* extconf.rb failed \*\*\*  
> > Could not create Makefile due to some reason, probably lack of necessary  
> > libraries and/or headers. Check the mkmf.log file for more details. You  
> > may  
> > need configuration options.
> > 
> > Provided configuration options:  
> > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-dir  
> > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-dir  
> > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-include  
> > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-include=${opt-dir}/include  
> > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-lib  
> > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-lib=${opt-dir}/lib  
> > &nbsp;&nbsp;&nbsp;&nbsp;--with-make-prog  
> > &nbsp;&nbsp;&nbsp;&nbsp;--without-make-prog  
> > &nbsp;&nbsp;&nbsp;&nbsp;--srcdir=.  
> > &nbsp;&nbsp;&nbsp;&nbsp;--curdir  
> > &nbsp;&nbsp;&nbsp;&nbsp;--ruby=/usr/local/bin/$(RUBY\_BASE\_NAME)  
> > &nbsp;&nbsp;&nbsp;&nbsp;--help  
> > &nbsp;&nbsp;&nbsp;&nbsp;--clean  
> > &nbsp;&nbsp;&nbsp;&nbsp;--use-system-libraries  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > `require': cannot load such file -- openssl (LoadError)  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/ruby/2.2.0/net/https.rb:22:in `\<top (required)\>'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/gems/2.2.0/gems/mini\_portile-0.6.2/lib/mini\_portile.rb:3:in  
> > `\<top (required)\>'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
> > `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
> > `rescue in require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:39:in  
> > `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;from extconf.rb:395:in `\<main\>'
> > 
> > extconf failed, exit code 1
> > 
> > Gem files will remain installed in  
> > /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.  
> > Results logged to  
> > /usr/local/lib/ruby/gems/2.2.0/extensions/x86\_64-linux/2.2.0-static/nokogiri-1.6.6.2/gem\_make.out
> > 
> > \*The other problem is that Ruby is failing to require openSSL whereas it  
> > is already installed in the computer. I'm changed the Ruby gem sources to  
> > [http://rubygems.org](http://rubygems.org) instead of the https:// version.  
> > I've rebuilt Ruby multiple times. Can someone help me out? I'm really stuck  
> > here and don't know what to do. \*
> > 
> > --  
> > Himel Sarkar,  
> > \*himelsarkarforever.blogspot.com \<[http://himelsarkarforever.blogspot.com](http://himelsarkarforever.blogspot.com)\>\*
> > 
> > \* Here's to the crazy ones. The misfits. The rebels. The troublemakers.  
> > The round pegs in the square holes. The ones who see things differently.  
> > They're not fond of rules. And they have no respect for the status quo. You  
> > can quote them, disagree with them, glorify or vilify them. About the only  
> > thing you can't do is ignore them. Because they change things. They push  
> > the human race forward. And while some may see them as the crazy ones, we  
> > see genius. Because the people who are crazy enough to think they can  
> > change the world are the ones who do.\*

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Atmatzidi](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@Panagiotis\_Atmatzidi](https://rubytalk.org/u/Panagiotis_Atmatzidi)\
**Post date:** [28 February 2015 05:44 UTC](https://rubytalk.org/t/fails-to-require-openssl/70601/3 "2015-02-28T05:44:07Z")

</div>

Hello,

Ubuntu and all debian derivatives have a sort of \*-dev packages, which are required. For example, to build ruby manually on digital ocean, you need the following command (as root or with ’sudo’):

> # 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 nodejs subversion

See if there’s anything missing from your ubuntu installation, for example ‘libssl-dev’ might be missing.

Panagiotis (atmosx) Atmatzidis

email: atma@convalesco.org  
URL: [http://www.convalesco.org](http://www.convalesco.org)  
GnuPG ID: 0x1A7BFEC5  
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

“There’s something that I’ve learned. I don’t believe in predetermined faith!” - Hitomi Kanzaki

---

<div class="post-metadata">

**Author:** ![Himel\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Himel\_Sarkar](https://rubytalk.org/u/Himel_Sarkar)\
**Post date:** [28 February 2015 04:44 UTC](https://rubytalk.org/t/fails-to-require-openssl/70601/4 "2015-02-28T04:44:40Z")

</div>

No I'm running Ubuntu 12.04

> **···**
>
> On Sat, Feb 28, 2015 at 1:35 AM, Eugeniu T. \<eugeniu.rtj@gmail.com\> wrote:
> 
> > Hi, if you have mac you need to isntall xcode, after it launch this  
> > command: xcode-select --install
> > 
> > 2015-02-27 20:19 GMT+01:00 Himel Sarkar \<hsarkar.007@gmail.com\>:
> > 
> > > Hey! So I had a little bit of a problem!
> > > 
> > > I'm running Ruby 2.2 with Rails 2.3. I'm trying upgrade rails to advances  
> > > versions. But everytime I run gem install rails. this happens.
> > > 
> > > himel@ubuntu:~/Downloads/Rubynew/ruby-2.2.0$ sudo gem install rails  
> > > Building native extensions. This could take a while...  
> > > ERROR: Error installing rails:  
> > > &nbsp;&nbsp;&nbsp;&nbsp;ERROR: Failed to build gem native extension.
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/ruby -r ./siteconf20150228-25704-26oogh.rb extconf.rb  
> > > checking if the C compiler accepts ... yes  
> > > Building nokogiri using packaged libraries.  
> > > \*\*\* extconf.rb failed \*\*\*  
> > > Could not create Makefile due to some reason, probably lack of necessary  
> > > libraries and/or headers. Check the mkmf.log file for more details. You  
> > > may  
> > > need configuration options.
> > > 
> > > Provided configuration options:  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-dir  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-dir  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-include  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-include=${opt-dir}/include  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--with-opt-lib  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--without-opt-lib=${opt-dir}/lib  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--with-make-prog  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--without-make-prog  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--srcdir=.  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--curdir  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--ruby=/usr/local/bin/$(RUBY\_BASE\_NAME)  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--help  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--clean  
> > > &nbsp;&nbsp;&nbsp;&nbsp;--use-system-libraries  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > > `require': cannot load such file -- openssl (LoadError)  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > > `require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/ruby/2.2.0/net/https.rb:22:in `\<top (required)\>'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > > `require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:54:in  
> > > `require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/gems/2.2.0/gems/mini\_portile-0.6.2/lib/mini\_portile.rb:3:in  
> > > `\<top (required)\>'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
> > > `require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:128:in  
> > > `rescue in require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from  
> > > /usr/local/lib/ruby/2.2.0/rubygems/core\_ext/kernel\_require.rb:39:in  
> > > `require'  
> > > &nbsp;&nbsp;&nbsp;&nbsp;from extconf.rb:395:in `\<main\>'
> > > 
> > > extconf failed, exit code 1
> > > 
> > > Gem files will remain installed in  
> > > /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.  
> > > Results logged to  
> > > /usr/local/lib/ruby/gems/2.2.0/extensions/x86\_64-linux/2.2.0-static/nokogiri-1.6.6.2/gem\_make.out
> > > 
> > > \*The other problem is that Ruby is failing to require openSSL whereas it  
> > > is already installed in the computer. I'm changed the Ruby gem sources to  
> > > [http://rubygems.org](http://rubygems.org) instead of the https:// version.  
> > > I've rebuilt Ruby multiple times. Can someone help me out? I'm really stuck  
> > > here and don't know what to do. \*
> > > 
> > > --  
> > > Himel Sarkar,  
> > > \*himelsarkarforever.blogspot.com \<[http://himelsarkarforever.blogspot.com](http://himelsarkarforever.blogspot.com)\>\*
> > > 
> > > \* Here's to the crazy ones. The misfits. The rebels. The troublemakers.  
> > > The round pegs in the square holes. The ones who see things differently.  
> > > They're not fond of rules. And they have no respect for the status quo. You  
> > > can quote them, disagree with them, glorify or vilify them. About the only  
> > > thing you can't do is ignore them. Because they change things. They push  
> > > the human race forward. And while some may see them as the crazy ones, we  
> > > see genius. Because the people who are crazy enough to think they can  
> > > change the world are the ones who do.\*
> 
> --  
> Himel Sarkar,  
> \*himelsarkarforever.blogspot.com \<[http://himelsarkarforever.blogspot.com](http://himelsarkarforever.blogspot.com)\>\*
> 
> \* Here's to the crazy ones. The misfits. The rebels. The troublemakers. The  
> round pegs in the square holes. The ones who see things differently.  
> They're not fond of rules. And they have no respect for the status quo. You  
> can quote them, disagree with them, glorify or vilify them. About the only  
> thing you can't do is ignore them. Because they change things. They push  
> the human race forward. And while some may see them as the crazy ones, we  
> see genius. Because the people who are crazy enough to think they can  
> change the world are the ones who do.\*
