I am using Ubuntu 12.10 64-bit and I have following packages installed :
dpkg --get-selections | grep postgre
output:
postgresql
postgresql-9.1
postgresql-client
postgresql-client-9.1
postgresql-client-common
postgresql-common
postgresql-contrib
postgresql-contrib-9.1
postgresql-server-dev-9.1
postgresql-server-dev-all
libpq-dev
libpq5
rvm 1.17.9
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]
I am not able to install pg gem I am getting following error :
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/vedarthk/.rvm/rubies/ruby-1.9.3-p362/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)
I have also tried following commands but the output is same as above :
gem install pg -- --with-pg-include=/usr/include/postgresql/libpq --with-pg-lib=/usr/lib/postgresql/9.1/lib
gem install pg -- --with-pg-include=/usr/include/postgresql --with-pg-lib=/usr/lib/postgresql/9.1/lib
build-essential
package as mentioned here: https://mcmap.net/q/55788/-how-to-install-postgresql-39-s-pg-gem-on-ubuntu. The other answers in that thread - particularly the ones aboutrvmsudo
- might help as well. – Archduchybuild-essential
is already installed and I have latest version. – Neutron