Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

Similarly,

$ which openssl
/usr/bin/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.

Thanks!

share|improve this question

3 Answers 3

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
popd

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

make
sudo make install
share|improve this answer

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

libssl-dev
libreadline-dev 

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

Then

[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
1  
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

Your Answer

 
discard

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.