postgres.app:如何在 Mac 上安装 libpq-dev?

问题描述 投票:0回答:1

我正在使用 postgres 应用程序运行最新版本的 postgres。

[mydir] (master) which psql
/Applications/Postgres.app/Contents/Versions/latest/bin/psql

当我尝试安装 RubyGem pg 时遇到错误。

ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    current directory: /Users/myusername/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/pg-0.21.0/ext
/Users/myusername/.rvm/rubies/ruby-3.0.0/bin/ruby -I /Users/myusername/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0 -r ./siteconf20210521-34776-tmn3lu.rb extconf.rb --with-pg-config\=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/latest/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.
....... other stuff here ........

通过检查过去几年有关此错误的许多帖子,很多旧帖子表示他们能够通过安装

libpq-dev
来修复这些类型的错误。

我见过这个命令作为安装它的一种方法,但 apt 在 Mac 上不可用。

sudo apt-get install libpq-dev

我见过其他使用 Homebrew 的解决方案。我不相信这是一个选项,因为我读过这将安装我不想要的 postgres 版本。

我正在使用 pgAdmin 5.3。

如何在我的 postgres.app 数据库中安装

libpq-dev
?我在网上或 postgres.app 文档中没有成功找到任何内容。

postgresql homebrew libpq postgresapp
1个回答
0
投票

尝试以下方法,它对我有用:

brew install postgresql
© www.soinside.com 2019 - 2024. All rights reserved.