Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup github-pages on my Ubuntu laptop, and following the guide provided by Github I have to install the bundler package; giving the command

~$ gem install bundler

returns me this error.

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

Then I have installed OpenSSL, launched the command to update software and stuff and tried again to install bundler, but the error kept showing.

How can I fix this? Is there any specific command to rebuild ruby making it aware about the fact that openSSL is now installed?

share|improve this question
Which openssl package did you install? I believe you'll need the development package in order to build against it (part of the bundler build steps). Try sudo apt-get install libssl-dev, try again and update your question. :) – gertvdijk Aug 19 '14 at 12:34
I've installed it, but nothing changes! I'm aware of my newbieness, so probably there exists a simple way of solving this, but for the moment I'm stuck on this! The problem is likely to be in the way I'm upgrading Ruby, I think! Is there any specific command to rebuild Ruby? – uomoinverde Aug 19 '14 at 12:49
Please include in your question all information on the Ruby specific changes you made to your system. The way Ruby is built may be very relevant to your issue now but we don't see that information currently. – gertvdijk Aug 19 '14 at 12:51
I've figured out how to solve the problem (with huge luck) by myself, I will answer to my own question, anyway thanks :-) I will provide as many details as possible! – uomoinverde Aug 20 '14 at 16:08
up vote 4 down vote accepted

I've found the answer to my own question, and I think it would be more clear to post as an answer, rather than editing the question.

1st try. Let's go through the path of non-safe source link.

As pointed out here, a possible choice to bypass the openSSL check is to remove the safe https link and add the non-safe one:

gem source -r
gem source -a

This way, the installation seems to go fine, but somewhere around the process openSSL is required again (for nokogiri gem, if I remember it well).

2nd try. Rebuild Ruby (it was so easy).

By the time I asked this question, my brain was probably not working properly. After installing openSSL by the usual way:

sudo apt-get install openssl

I got to my ruby directory and typed the following lines:

pushd ext/openssl
ruby extconf.rb
make install

This way, I had all dependencies issues and stuff solved (I guess). Then, running

make install

I've rebuilt Ruby and finally the installation went fine.

share|improve this answer
I've tried your 2nd step but it failed. 1st one was still needed – mantrid Apr 12 at 9:25

Rebuilding ruby after sudo apt-get install libssl-dev libreadline-dev libgdbm-dev can solve this issue.

The solution is found here:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.