sauronnikko
sauronnikko

Reputation: 5435

Can't install pg gem

I have the following problem when trying to install the pg gem. My OS is Ubuntu 12.10. I've already installed postgresql (via the installer from the postgres page). I've also done apt-get install of libpq5 and libpq-dev. This is the error:

ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /home/sauronnikko/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/sauronnikko/.rvm/rubies/ruby-1.9.3-p385/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib

Can you help me? Thanks

Upvotes: 1

Views: 2552

Answers (1)

Zakaria
Zakaria

Reputation: 1013

sudo apt-get install postgresql libpq-dev

then

bundle install

see this page: Rails 3 - can't install pg gem

Upvotes: 4

Related Questions