Search code examples
rubyubuntuinstallationrbenv

Installing libssl-dev on ubuntu for ruby 2.0


I tryed to install ruby 2.0 with rbenv on Ubuntu 12.04:

rbenv install 2.0.0-p247

Now I got the following error message:

Installing ruby-2.0.0-p247...

BUILD FAILED

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

Last 10 log lines:
installing default gems:      /home/chris/.rbenv/versions/2.0.0-p247/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?

In this Question Sam Ruby said I should install libssl-dev and I try it with:

sudo apt-get install libssl-dev

Now I got this error:

dpkg: Fehler: Parsen der Datei »/var/lib/dpkg/available«, nahe Zeile 10:
 package name fehlt
E: Sub-process /usr/bin/dpkg returned an error code (2)

Could somebody explain me what is the problem and how can I solve it, please.


Solution

  • Your /var/lib/dpkg/available file got corrupted. You can fix it with the following:

    1. Backup your existing /var/lib/dpkg/available via: sudo cp /var/lib/dpkg/available /var/lib/dpkg/available.backup

    2. Then run the following, this will clear the file: sudo dpkg --clear-avail

    3. You should be able to install packages again as usual: sudo apt-get update && sudo install libssl-dev

    Source: Ubuntu dpkg manpage

    If none of the above helps, try asking on AskUbuntu