Não é possível instalar o PG rubygem no Centos

1

Estou tentando executar gem install pg no meu VPS do Centos, mas estou recebendo

Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby
    --with-pg
    --without-pg
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/

Eu instalei o postgres 9.3 como você pode ver aqui ( yum list installed | grep postgres )

postgresql-libs.x86_64              8.4.13-1.el6_3                     @base
postgresql93.x86_64                 9.3.1-1PGDG.rhel6                  @pgdg93
postgresql93-devel.x86_64           9.3.1-1PGDG.rhel6                  @pgdg93
postgresql93-libs.x86_64            9.3.1-1PGDG.rhel6                  @pgdg93
postgresql93-server.x86_64          9.3.1-1PGDG.rhel6                  @pgdg93
    
por Kyle Decot 15.10.2013 / 17:53

2 respostas

2

Experimente esta solução e reinicie sua sessão

export PATH="/usr/pgsql-9.3/bin:$PATH"

ou tente

yum install libpqxx-devel
gem install pg -- --with-pg-config=/usr/pgsql-9.4/bin/pg_config
    
por 21.10.2015 / 21:39
1

Você pode instalar as bibliotecas postgresql usando o yum:

yum install postgresql-libs

Isso deve instalar a biblioteca referida para que você possa tentar instalar a gem novamente.

    
por 15.10.2013 / 20:46