ruby-pg fails to build on Ubuntu 12.04 with postgres 9.1.4

Issue #130 invalid
created an issue

The gem fails to build on Ubuntu 12.04 with postgres 9.1.4. This issue can be reproduced with version 0.10-0.14 using Ruby 1.9.2

Comments (7)

  1. Michael Granger repo owner
    • changed status to open

    I'm going to need more information. From my Ubuntu 12.04 box:

    ubuntu 23:15:30 [~] (rev 157:cf4018e0897c!)
    19/149 {0} $ sudo gem install pg
    Fetching: pg-0.14.0.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed pg-0.14.0
    1 gem installed
    Installing RDoc documentation for pg-0.14.0...
    ubuntu 23:15:49 [~] (rev 157:cf4018e0897c!)
    20/150 {0} $ ruby -v
    ruby 1.9.3p194 (2012-04-20) [x86_64-linux]
    ubuntu 23:15:50 [~] (rev 157:cf4018e0897c!)
    21/151 {0} $ psql --version
    psql (PostgreSQL) 9.1.4
    contains support for command-line editing

    Of note is that this is a hand-installed Ruby, built from source and installed in /usr/local (I got tired of wrestling with Ubuntu's idea of a Ruby installation), so that's one possible deviation.

    Also, pg isn't technically supported on Ruby 1.9.2, but I doubt it's that.

    For a few guidelines on what stuff to add to the ticket, and how to help us troubleshoot your problem, see Submitting TIckets.

  2. Lars Kanis

    This is not true - for me it works! You must install the necessary dev files before installing the gem:

    sudo apt-get install libpq-dev

    Please also post the output of gem install and the content of <install-dir-of-pg-gem>/ext/mkmf.log .

  3. Lars Kanis

    Hi @homebrewtc,

    there is something wrong with your Ubuntu installation. extconf.rb can not link to libssl and libcrypto, which isn't directly used by pg.gem, but by Usually the dynamic linker should find libssl and libcrypto here:

    $ ldd /usr/lib/
   =>  (0x00007fff05bff000)
   => /lib/x86_64-linux-gnu/ (0x00007ffb2a63a000)
   => /lib/x86_64-linux-gnu/ (0x00007ffb2a272000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007ffb29fa3000)

    The files should be there:

    $ ll /lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/*
    -rw-r--r-- 1 root root 1612544 Apr 24 17:27 /lib/x86_64-linux-gnu/
    -rw-r--r-- 1 root root 1852792 Mai 23 02:07 /lib/x86_64-linux-gnu/
    -rw-r--r-- 1 root root  338048 Apr 24 17:27 /lib/x86_64-linux-gnu/
    -rw-r--r-- 1 root root  374608 Mai 23 02:07 /lib/x86_64-linux-gnu/

    And should be used (at least after a sudo ldconfig), since they are in the ld.conf:

    $ cat /etc/
    # Multiarch support

    Hope this helps.

  4. Log in to comment