Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have a fresh Ubuntu 12.04 VM, and I would like to install Ruby 2.0.0-p0. I am able to get Ruby installed easily enough, but I am unable to get gems to work.

$ gem install bundler
ERROR:  Loading command: install (LoadError)
cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

I have open SSL installed, so I'm not exactly sure what the problem is.

$ sudo apt-get install libssl1.0.0 libssl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libssl-dev is already the newest version.
libssl1.0.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


$ which openssl

If I go back to the installation, there are two lines that concern me.

$ sudo make install
Failed to configure openssl. It will not be installed.
Failed to configure readline. It will not be installed.


share|improve this question

4 Answers 4

In your source location, cd ext/openssl and then ruby extconf.rb. This will generate a makefile in the ext/openssl directory. Simply make && sudo make install it to build the ruby openssl extension, and install the .so into the appropriate location.

Ditto ext/readline for readline support.

Then you should be able to make ruby properly.

Edit: in case I wasn't clear enough:

pushd ext/openssl
ruby extconf.rb
make && sudo make install

pushd ext/readline
ruby extconf.rb
make && sudo make install

sudo make install
share|improve this answer

I ran into the same issue, I had to install the following two packages


in fact I found I had to install the following packages to get ruby 2.0.0 and postgres 9.2 to compile on ubuntu 13.04 with openssl and readline so I thought I would share them

sudo apt-get -y update
sudo apt-get install -y make g++
sudo apt-get install -y curl git-core python-software-properties
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev
sudo apt-get install -y libgdbm-dev libreadline6-dev libncurses5-dev
sudo apt-get install -y libpq-dev libffi-dev
share|improve this answer

When installing ruby 2.0, it is possible that rubygems 2.0 installation did not complete ok, because of openssl. Make sure you provide a valid path to the openssl config file; you could:

find . -type f -name "openssl.cnf"

path is usually $HOME/.rvm/usr or $HOME/.rvm/usr/ssl


[sudo] rvm reinstall ruby-2.0.0-p0 --with-openssl-dir=[openssl.cnf path] --verify-downloads 1

Make sure rubygems installation complete successfully. Might be a better way to fix that path without reinstalling, but this should do it.

share|improve this answer
I am trying an install without RVM or RBENV. Just compiling from sources. Hence the ./configure, make, and make install steps. Thank you, though. – Jarrett Meyer Mar 1 '13 at 20:57

for me it was a case of missing dependencies.

i thought i had all the dependencies required to install ruby, but i too was getting an openSSL and readline error.

i attempted to install ruby with RVM without root privileges which failed but gave me a list of missing dependencies. i then installed the dependencies with a package manager. i then re-attempted to install ruby from source from the beginning, and everything worked OK

the dependencies that were missing, for me, were:

patch libyaml-devel autoconf gcc-c++ patch readline-devel libffi-devel openssl-devel automake libtool bison sqlite-devel

but they may be different for you.

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.