1

When running 'bundle install' I get the following error message.

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

    /Users/name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.

I've tried installing http://postgresapp.com/

but I am still getting the issue? Any ideas?

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
jdeleon
  • 63
  • 2
  • 7

1 Answers1

2

you need to pass a couple of options on the command line. like this
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
If you installed postgres to a different location then you'll need to fix up the path to the pg_config file.

Roman Kiselenko
  • 43,210
  • 9
  • 91
  • 103