2016-11-05 76 views
0

尝试几种方法用自制的安装和RVM我仍然无法安装宝石PG无法在轨道上

我使用的所有回答#问题,但他们并没有帮助我在所有安装后的宝石PG红宝石。

我正在使用Postgresql应用程序

我的问题是我做错了什么? 因为主要的问题是,我不能在我的Mac

$ sudo gem install pg -v '0.19.0' 
Building native extensions. This could take a while... 
ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/bin/pg_config 
checking for libpq-fe.h... yes 
checking for libpq/libpq-fs.h... yes 
checking for pg_config_manual.h... yes 
checking for PQconnectdb() in -lpq... no 
checking for PQconnectdb() in -llibpq... no 
checking for PQconnectdb() in -lms/libpq... no 
Can't find the PostgreSQL client library (libpq) 
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
    --with-pg 
    --without-pg 
    --enable-windows-cross 
    --disable-windows-cross 
    --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}/ 
    --with-pqlib 
    --without-pqlib 
    --with-libpqlib 
    --without-libpqlib 
    --with-ms/libpqlib 
    --without-ms/libpqlib 


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/pg-0.19.0 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/gems/pg-0.19.0/ext/gem_make.out 
+0

您试过了哪些解决方案?这可能有助于了解什么不起作用以及这些尝试的结果是什么...... 我遇到过与'pg'类似的问题,其中的错误几乎与此类似。 – Antonio

+0

@Antonio我试过这个和rvm命令也冲泡卸载postgresql brew安装postgresql gem install pg – GYTO

+0

您是否尝试过从头重新安装XCode?我相信这是在过去当我升级到埃尔卡皮坦的时候让我经历了这个驼峰。 http://stackoverflow.com/questions/19262312/installing-pg-gem-on-os-x-failure-to-build-native-extension – Antonio

回答

0

它说,它无法找到PostgreSQL的客户端库安装PG我没有创建为PG用户。

看看这个答案。这个问题的输出是,从我所能看到的,排成一行,与你所拥有的相同。

Can't find the PostgreSQL client library (libpq)

+0

其作品,谢谢 – GYTO

+0

@GYTO, 您能将它标记为正确的答案吗?所以,如果别人有类似的问题,并且遇到了这个问题,他们会知道什么是有效的。 – Antonio

+0

@Antonia对不起,我很忙,现在解决了,再次感谢 – GYTO