0

I have a rails app that I want to start working on, but I just can't get past this one error. I cannot install the pg -v -0.10.1 gem I have tried reinstalling Postgressql from my entire system and that didn't work. I have tried to run the command below and it works successfully but I still can't run bundle install successfully.

env ARCHFLAGS="-arch x86_64" gem install pg 

I followed the instructions of this thread step by step but no cigar.

I just keep getting the error message below.

`Building native extensions with: '--with-pg-config= /usr/local/bin/pg_config'
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 extconf.rb --with-pg-config= /usr/local/bin/pg_config
Using config values from 
sh: : command not found
sh: : command not found
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
        --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
    enter code here

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/pg-0.18.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.18.2/ext/gem_make.out`
Community
  • 1
  • 1
sanoy
  • 115
  • 3
  • 9
  • you need the pg dev libraries. Try this: http://superuser.com/questions/296873/install-libpq-dev-on-mac-os – Mircea Jul 09 '15 at 06:19
  • I have already tried that no cigar. – sanoy Jul 09 '15 at 06:31
  • Is version 0.10.1 a necessity? I think I'm using 0.18.0 right now – Arman Jul 09 '15 at 06:36
  • Well thats whats in the gem file. So it remains in the gem file then yes. I would be open to changing the version in the Gemfile if that is the problem. Do you think that the version is the issue? – sanoy Jul 09 '15 at 06:39
  • Do you have postgres locally installed? If your on a mac look for package manager called `brew`. Installing postgres is as simple as `brew install postgres`. Try to install the gem afterwards ! Hope this helps – Jens Jul 09 '15 at 14:54
  • I have brew installed and I also ran brew install postgres. – sanoy Jul 09 '15 at 16:27
  • This output: _checking for PQconnectdb() in -lpq... no_ indicates that despite being installed, it's not able to link a simple program with postgres client library. The error details should be in the mentioned `mkmf.log`. – Daniel Vérité Jul 09 '15 at 19:05

0 Answers0