I had a problem similar to this one, on my Docker host computer. I was able to fix it by installing libpq-dev
on the host machine, as suggested.
But when I create a Docker image using ubuntu:16.04
as a base, I get the same error, but none of the suggested answers seem to work.
I've exec'd into the container and installed all the suggested packages but I keep getting back the error message:
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=/opt/puppetlabs/puppet/bin/ruby --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --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-pqlib --without-pqlib --with-libpqlib --without-libpqlib --with-ms/libpqlib --without-ms/libpqlib
extconf failed, exit code 1
Gem files will remain installed in /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/pg-0.20.0 for inspection. Results logged to /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/pg-0.20.0/gem_make.out
I'm wondering if this might be an issue of the package being installed but not found for some reasons? Any ideas to go about debugging?