Pg Gem installation issue after upgrading Ruby2.2 for Rails3.2.18

Skip to first unread message


Aug 22, 2019, 1:09:18 PM8/22/19

Under ubuntu-12.04_32bit OS, i installed with Ruby 1.9.3 and Rails 3.2.18.

Postgresql DB server is: 9.1, pg gem -v '0.13.2'

After upgrading Ruby from 1.9.3 to 2.2.0, i'm not able to do any rake operations. With this error

So i was trying to upgrade pg gem from 0.13.2 to >=0.15.1 version.

I ended up with Following error, not able to resolve this. Can someone please help me to resolve this issue?

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/blueserver/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20190822-25751-10e8nmf.rb extconf.rb --with-pg-config=/usr/bin/pg_config
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:

extconf failed, exit code 1

Gem files will remain installed in /home/blueserver/.rvm/gems/ruby-2.2.0/gems/pg-0.15.1 for inspection.
Results logged to /home/blueserver/.rvm/gems/ruby-2.2.0/extensions/x86-linux/2.2.0/pg-0.15.1/gem_make.out
An error occurred while installing pg (0.15.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.1'` succeeds before bundling.

Note: I tried different resources from Google, but no luck.

Aug 24, 2019, 1:01:00 PM8/24/19
Hello Pavan,

Go to the pg gem homepage or github account. They know the gem and can help

You received this message because you are subscribed to the Google Groups "" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


Sep 9, 2019, 9:36:00 AM9/9/19
install libpq , libpq-dev
Reply all
Reply to author
0 new messages