2012-12-02 148 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