I am trying to bundle install, but, for some strange reason, the pg gem is returning the following error on install:
$ gem install pg -v \'0.18.4\'
Building
If the PostgreSQL client library is installed, then you need to tell gem where to look for the include files, which it does by asking pg_config
. I use a little shell file to make it easier for gem to find that utility:
#!/bin/sh -x
PATH=/Library/PostgreSQL/9.4/bin:$PATH
gem install pg $@
You could also manually adjust your PATH to always include the PostgreSQL bin directory, which should fix the problem permanently.
If you upgrade your PostgreSQL that path will change, so you might need to reinstall pg and/or change your PATH setting.
Once pg is installed, further upgrades to the gem will be able to install without rerunning the script.
You should probably install the PostgreSQL development libraries.
If you're on Ubuntu this will help:
sudo apt-get install libpq-dev
On a Mac:
brew install postgresql
You need to configure pg correctly.
Run:
bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/(YOUR POSTGRES VERSION)/bin/pg_config
Then try to run bundle:
bundle install