gpt4 book ai didi

ruby-on-rails - pg 1.0.0 `fatal error: ' libpq-fe.h' 文件未找到`

转载 作者:行者123 更新时间:2023-12-03 13:51:28 24 4
gpt4 key购买 nike

安装 pg (1.0.0) 时出错,Bundler 无法继续

我在安装包时遇到问题,无法完成安装。

我该怎么做才能完成捆绑包?

  find_executable: checking for pg_config... -------------------- no

--------------------

find_header: checking for libpq-fe.h... -------------------- no

"clang -o conftest -I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-2.4.0/x86_64-darwin17 -I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/backward -I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-2.4.0 -I. -I/Users/leotyndall/.rbenv/versions/2.4.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-error=shorten-64-to-32 -pipe conftest.c -L. -L/Users/leotyndall/.rbenv/versions/2.4.2/lib -L. -L/Users/leotyndall/.rbenv/versions/2.4.2/lib -fstack-protector -L/usr/local/lib -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */

"clang -E -I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-2.4.0/x86_64-darwin17 -
I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-
2.4.0/ruby/backward -
I/Users/leotyndall/.rbenv/versions/2.4.2/include/ruby-2.4.0 -I. -
I/Users/leotyndall/.rbenv/versions/2.4.2/include -D_XOPEN_SOURCE -
D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-
error=shorten-64-to-32 -pipe conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
^~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
/* end */

--------------------


extconf failed, exit code 1


An error occurred while installing pg (1.0.0), and Bundler cannot continue.
Make sure that `gem install pg -v '1.0.0'` succeeds before bundling.

最佳答案

尝试安装 libpq-dev或者它的等效于您的操作系统:

  • 对于 Ubuntu 系统:sudo apt-get install libpq-dev
  • Red Hat Linux (RHEL) 系统:yum install postgresql-devel
  • 对于 Mac Homebrew :brew install postgresql
  • 对于 Mac MacPorts PostgreSQL:gem install pg -- --with-pg-config=/opt/local/lib/postgresql[version number]/bin/pg_config
  • 对于 OpenSuse :zypper in postgresql-devel
  • 关于ruby-on-rails - pg 1.0.0 `fatal error: ' libpq-fe.h' 文件未找到`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50272096/

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