包失败-找不到PostgreSQL客户端库(libpq) [英] bundle failing - Can't find the PostgreSQL client library (libpq)

查看:532
本文介绍了包失败-找不到PostgreSQL客户端库(libpq)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我已经尝试了所有有关此问题的建议。

I think I have tried all the suggestions I could find regarding this issue. Still not working for me.

当我尝试捆绑...

$ bundle
...

Gem::Installer::ExtensionBuildError: 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
    --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
...
An error occurred while installing pg (0.17.1), and Bundler cannot
continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before
bundling.

先前代码的输出...

Output from previous code...

$ which bundle
/Users/Loren/.rvm/gems/ruby-2.1.1@global/bin/bundle

$ which gem
/Users/Loren/.rvm/rubies/ruby-2.1.1/bin/gem

$ which psql
/usr/local/bin/psql

我尝试使用Homebrew卸载postgresql并重新安装,但这没有帮助。

I tried to uninstall postgresql using Homebrew and reinstall and that didn't help.

我尝试过...

ARCHFLAGS="-arch x86_64" gem install pg

并成功完成,但是当我运行 bundle 时,我仍然得到

and that completes successfully but then when I run bundle I still get the same error.

我尝试过...

gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config

那没有用。

我尝试了...

gem install pg -v '0.17.1' -- --with-pg-config=/usr/local/Cellar/postgresql/9.3.2/bin/pg_config

也不起作用。

我不确定还有什么可以尝试的在此刻。
感谢您的帮助。

I am not sure what else to try at this point. Thanks for any help.

推荐答案

我的解决方案最终在此

ARCHFLAGS="-arch x86_64" bundle install

这篇关于包失败-找不到PostgreSQL客户端库(libpq)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆