Sunday, March 30, 2014

Postgre SQL on a Mac

I'm a Mac user (I know, I know, I should be using Linux) and sometimes there are some differences when using Rails and Ruby. For instance, I was trying to get the Postgre SQL gem to install and it was telling me that it could find the appropriate header files:

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

    /Users/username/.rvm/rubies/ruby-2.0.0-p353/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 did some googling and found that Macports is a useful tool for getting these Postgre SQL headers installed. After installing it and running the commands found on this blog, the bundle install command worked!

No comments:

Post a Comment