0

I know that similar questions have been asked, but none of the solutions have worked for me. I'm running Mac OS 10.10.1. I'm using RVM and Homebrew. When I run 'gem install pg' I get the following:

Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150118-2187-o8ph5p.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/local/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
    --without-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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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}/
    --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 /Library/Ruby/Gems/2.0.0/gems/pg-0.18.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/pg-0.18.1/gem_make.out

I see where it suggests checking my mkmf.log, but I can't seem to find that! I've tried tearing out RVM and reinstalling it, I've tried uninstalling postgresql in Brew, uninstalling the Postgres app, I've checked that I'm using xcode 6.1.1 etc. etc. I've tried every solution suggested here

unable to install pg gem

And here bundle failing - Can't find the PostgreSQL client library (libpq)

But no luck!

I've been poring over Stack Exchange and elsewhere for hours now, but it seems like everyone's having a slightly different problem and no one else's solutions are working for me. Any other ideas?

Community
  • 1
  • 1
  • I guess you can refer https://stackoverflow.com/questions/4827092/unable-to-install-pg-gem/30728745#30728745 for the same question. – Mahattam Apr 16 '19 at 04:00

1 Answers1

0

Solved. I had neglected to install pgadmin III, so the libraries it was linking to were the wrong ones.