My DB is PostgreSQL.I am on CENTOS.... While installing the pg gem I received the following error. I reinstalled to clear my YAML problem also, which didn\'t work, but it is jus
First install
sudo apt-get install postgresql postgresql-server-dev-9.1
Next install
sudo apt-get install libpq-dev
Then install gem install pg
I got the same problem and I tried to install all dependencies, but all is useless. In the end, I had a try to use PostgreSQL9.3, not PostgreSQL9.4, and everything is fine.
My problem is before pg gem was already installed.. but it is not loading to bundle.. Now the solution is: when we are declaring a new application like 'rails new Demo' we have to include
'--database=postgresql'. so now the total command is: 'rails new Demo --database=postgresql'
Then the pg gem file will gets to bundle..
In bundle only one gem will gets store . either pg gem or sqlite3 gem..
Now edit the database.yml file accordingly.. thats it
Try This, the answer is not mine but it worked for me. Remember to point to where your Postgres.app application is:
bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Then do
bundle update
bundle install