I tried using gem install pg but it doesn\'t seem to work.
gem install pg gives this error
Temporarily enhancing PATH to in
gem install pg -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config
I'd this issue on Linux Mint (Maya) 13, And I fixed it by Installing postgresql and postgresql-server :
apt-get install postgresql-9.1
sudo apt-get install postgresql-server-dev-9.1
I had to do this on CentOS 5.8. Running bundle install kept causing issues since I couldn't force it to use a particular PG version.
I can't yum erase postgresql postgresql-devel either, because of dependency issues (it would remove php, http etc)
The solution? Mess $PATH temporarily to give preference to the update pgsql instead of the default one:
export PATH=/usr/pgsql-9.2/bin:$PATH
bundle install
Basically, with the above commands, it will look at /usr/pgsql-9.2/bin/pg_config before the one in /usr/bin/pg_config
If you are using Postgres.app on Mac, you may resolve this issue once and for all like this:
First gem uninstall pg, then edit your ~/.bash_profile or ~/.zshrc file or equivalent and add:
# PostgreSQL bin path
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
Then bundle install and gem install pg should both work as expected.
Answered here: Can't install pg gem on Windows
There is no Windows native version of latest release of pg (0.10.0) released yesterday, but if you install 0.9.0 it should install binaries without issues.
On Mac brew install postgres THEN bundle install