嘗試幾種方法用自制的安裝和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
您試過了哪些解決方案?這可能有助於瞭解什麼不起作用以及這些嘗試的結果是什麼...... 我遇到過與'pg'類似的問題,其中的錯誤幾乎與此類似。 – Antonio
@Antonio我試過這個和rvm命令也沖泡卸載postgresql brew安裝postgresql gem install pg – GYTO
您是否嘗試過從頭重新安裝XCode?我相信這是在過去當我升級到埃爾卡皮坦的時候讓我經歷了這個駝峯。 http://stackoverflow.com/questions/19262312/installing-pg-gem-on-os-x-failure-to-build-native-extension – Antonio