Can't find the 'libpq-fe.h header when trying to install pg gem

前端 未结 30 1486
深忆病人
深忆病人 2020-11-22 07:47

I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error:



        
30条回答
  •  情话喂你
    2020-11-22 08:24

    Can't find the libpq-fe.h header

    i had success on CentOS 7.0.1406 running the following commands:

    ~ % psql --version # => psql (PostgreSQL) 9.4.1
    yum install libpqxx-devel
    gem install pg -- --with-pg-config=/usr/pgsql-9.4/bin/pg_config
    

    Alternatively, you can configure bundler to always install pg with these options (helpful for running bundler in deploy environments),

    • bundle config build.pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config

提交回复
热议问题