ShivvyBee
ShivvyBee

Reputation: 353

Installing ruby-2.0.0-p0 with rbenv BUILD FAILED

So I tried to install ruby through rbenv on my new ubuntu 12.04LTS running on VirtualBox.

I got rbenv from https://github.com/sstephenson/rbenv and ruby-build from https://github.com/sstephenson/ruby-build.

and then i run the following but build fails :(

rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

Inspect or clean up the working tree at /tmp/ruby-build.20130506102349.2564
Results logged to /tmp/ruby-build.20130506102349.2564.log

Last 10 log lines:
installing default gems:      /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0     (build_info, cache, doc, gems, specifications)
                          bigdecimal 1.2.0
                          io-console 0.4.2
                          json 1.7.7
                          minitest 4.3.2
                          psych 2.0.0
                          rake 0.9.6
                          rdoc 4.0.0
                          test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Any help would be appreciated. Let me know if you need any more details. Thanks!

Upvotes: 8

Views: 6777

Answers (3)

Hari
Hari

Reputation: 11

Hit the same issue. moschop's suggestion on the thread worked!

sudo apt-get install libssl-dev

and then

rbenv install 2.0.0-p247

You will have to rehash everytime you install a Ruby version or a gem

 rbenv rehash

Make a Ruby version default:

rbenv global 2.0.0-p247

Upvotes: 0

Sam Ruby
Sam Ruby

Reputation: 4340

You are going to need libssl-dev. For best results install all of the requirements which rvm autolibs function will install for you. Some of them (like sqlite3) presume that you will ultimately be wanting to install Rails, but aren't harmful if you don't need them.

Upvotes: 10

Martin
Martin

Reputation: 7714

Most probably you need the openssl extension as a prerequisite :

sudo apt-get install openssl

should to the trick. Relaunch your RBENV install afterwards.

Upvotes: 1

Related Questions