PostgreSQL gem pg was unable to install

前端 未结 10 762
孤城傲影
孤城傲影 2021-01-31 09:23

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

相关标签:
10条回答
  • 2021-01-31 09:39

    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

    0 讨论(0)
  • 2021-01-31 09:40

    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.

    0 讨论(0)
  • 2021-01-31 09:51

    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

    0 讨论(0)
  • 2021-01-31 09:52

    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
    
    0 讨论(0)
提交回复
热议问题