Issue #130 invalid

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

homebrewtc
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 libpq.so. Usually the dynamic linker should find libssl and libcrypto here:

    $ ldd /usr/lib/libpq.so
            linux-vdso.so.1 =>  (0x00007fff05bff000)
            libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007ffb2a63a000)
            libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007ffb2a272000)
            libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007ffb29fa3000)
            [...]
    

    The files should be there:

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

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

    $ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf
    # Multiarch support
    /lib/x86_64-linux-gnu
    /usr/lib/x86_64-linux-gnu
    

    Hope this helps.

  4. homebrewtc reporter

    (Reply via ry...@invalidchecksum.net):

    Yes. This appears to a be a problem isolated to chef with omnibus installs. Thanks for your help!

  5. Log in to comment