为了账号安全,请及时绑定邮箱和手机立即绑定

找不到PostgreSQL客户端库(libpq)

找不到PostgreSQL客户端库(libpq)

波斯汪 2019-08-12 09:48:54
找不到PostgreSQL客户端库(libpq)我正在尝试在Mac OS X 10.6上安装PostgreSQL for Rails。首先我尝试了MacPorts安装,但是进展不顺利,所以我做了一键式DMG安装。这似乎有效。我怀疑我需要安装PostgreSQL开发包,但我不知道如何在OS X上执行此操作。这是我尝试做的事情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贡献1804条经验 获得超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...

成功了!


查看完整回答
反对 回复 2019-08-12
  • 3 回答
  • 0 关注
  • 1656 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信