gpt4 book ai didi

ruby-on-rails - gem install pg 在 Mac El Capitan 上不起作用

转载 作者:行者123 更新时间:2023-12-04 07:34:37 29 4
gpt4 key购买 nike

我试图在 Mac El Capitan 上安装 pg Gem,但我总是收到此错误:

    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.        /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Users/ricardolopes/Developer/homebrew/bin/pg_config    Using config values from /Users/ricardolopes/Developer/homebrew/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        --enable-windows-cross        --disable-windows-cross        --with-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 /Users/ricardolopes/Code/site-noticias/vendor/bundle/ruby/2.0.0/gems/pg-0.18.3 for inspection.    Results logged to /Users/ricardolopes/Code/site-noticias/vendor/bundle/ruby/2.0.0/gems/pg-0.18.3/ext/gem_make.out    An error occurred while installing pg (0.18.3), and Bundler cannot continue.    Make sure that gem install pg -v '0.18.3' succeeds before bundling.

I also tried:

ARCHFLAGS="-arch x86_64" gem install pg

当我尝试时,我得到:

构建原生扩展。这可能需要一段时间...
成功安装 pg-0.18.3
无效选项:-f Fivefish
(无效选项被忽略)
解析 pg-0.18.3 的文档
3 秒后完成 pg 的文档安装
安装了 1 个 gem

但我跑 bundle install并在本文开头发布相同的错误。

我尝试从 brew 重新安装 PostgresSQL。

最佳答案

尝试这个:

  • 酿造更新
  • brew 安装 postgresql
  • sudo gem install pg -v '版本'
  • 关于ruby-on-rails - gem install pg 在 Mac El Capitan 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33337343/

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