找不到PostgreSQL客戶端庫(libpq)我正在嘗試在Mac OS X 10.6上安裝PostgreSQL for Rails。首先我嘗試了MacPorts安裝,但是進(jìn)展不順利,所以我做了一鍵式DMG安裝。這似乎有效。我懷疑我需要安裝PostgreSQL開發(fā)包,但我不知道如何在OS X上執(zhí)行此操作。這是我嘗試做的事情sudo gem install pg:$ sudo gem install pgBuilding native extensions. This could take a while...ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yesUsing config values from /Library/PostgreSQL/8.3/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... nochecking for PQconnectdb() in -llibpq... nochecking for PQconnectdb() in -lms/libpq... noCan'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/1.8/usr/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/pg-0.11.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/pg-0.11.0/ext/gem_make.out
3 回答

慕婉清6462132
TA貢獻(xiàn)1804條經(jīng)驗 獲得超2個贊
$ sudo su
$ env ARCHFLAGS="-arch x86_64" gem install pg
Building native extensions. This could take a while...
Successfully installed pg-0.11.0
1 gem installed
Installing ri documentation for pg-0.11.0...
Installing RDoc documentation for pg-0.11.0...
成功了!
- 3 回答
- 0 關(guān)注
- 1839 瀏覽
添加回答
舉報
0/150
提交
取消