2012-12-02 151 views
5

pg gem很顽固,所以我无法在新电脑上加载我的应用程序。好像多的问题,不能够找到pg_config然后extconf.rb无法在Fedora 17上安装PG gem

#psql working... 
psql (9.2.1) 
Type "help" for help. 

nd => 
\q 

$ pg_config: 

#adding the path to bashrc... 
$ nano .bashrc 

PATH=/usr/pgsql-9.2/bin:$PATH 

#seems to work... 
pg_config: /usr/pgsql-9.2/bin/pg_config 

$ sudo gem install pg 

#but i get the same errors... 
Building native extensions. This could take a while... 
....... 
ERROR: Error installing pg: 
     ERROR: Failed to build gem native extension. 

     /usr/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. 

任何Linux的人在那里,已经处理了这个问题?

回答

17

这解决了

$ yum install /usr/include/libpq-fe.h 
0

〜嗨

我在我的Rails项目安装宝石“PG”,当运行命令“包安装”有同样的错误了同样的问题,在我的情况如下partiuclar解决这个问题:

我使用Fedora 19,我想它可以以同样的方式来解决了Fedora 17:

我使用Postgres的次安装Ë以下教程:

然后,我添加了下一行,我的〜/ .bashrc解决与pg_config问题:

  • PATH =/usr/pgsql-9.2/bin: $ PATH

最后解决Libpq的-fe.h的问题,我安装PostgreSQL的-devel的如下:

  • # yum install postgresql92-devel
在我的Rails项目

最后运行的命令 “包安装” 和没有更多的错误。

9

适用于Fedora 20+,需要以下的软件包:

sudo yum install postgresql-devel