gpt4 book ai didi

ruby-on-rails - $ bundle update - 错误 - 找不到 PostgreSQL 客户端库 (libpq) *** extconf.rb 失败 ***

转载 作者:行者123 更新时间:2023-11-29 12:06:43 25 4
gpt4 key购买 nike

我想跑$bundle 更新,但在通过以下几个 gem 后它会出错:

Installing pg (0.11.0) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /opt/local/lib/postgresql83/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.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/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
from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `each'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `build_extensions'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:198:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:252:in `update'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

您是否看到过这个问题或对这里发生的问题有任何想法?谢谢

最佳答案

当你试图将 postgres gem 编译成 ruby​​ 时,你必须安装一个开发版本的 Posgtresql 库,在 Ubuntu(Debian 等)中它被命名为 libpq-dev 和客户端库,它被命名为 libpqx (x是这个库的版本)。

关于ruby-on-rails - $ bundle update - 错误 - 找不到 PostgreSQL 客户端库 (libpq) *** extconf.rb 失败 ***,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6026502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com