gpt4 book ai didi

postgresql - 设置 : The program 'pg_config' is required but it could not be found

转载 作者:行者123 更新时间:2023-11-29 11:39:03 29 4
gpt4 key购买 nike

在 nixos 上,当尝试使用 $ stack --nix build 构建我的项目时,我遇到了以下错误。

$ stack --nix build

...

Linking /run/user/1000/stack25943/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
Configuring postgresql-libpq-0.9.2.0...
setup: The program 'pg_config' is required but it could not be found.

我已经按照 nixos manual 安装了 postgres并且安装了 pg_config,如

所示
$ which pg_config
/run/current-system/sw/bin/pg_config

看起来堆栈不知道我的 pg_config 的这个位置。

我如何才能使 $ stack --nix build 成功?

最佳答案

您需要将 Nix 包添加到它正在构建 Haskell 包的 nix-shell 环境中。

stack.yaml 中:

nix:
packages: [postgresql]

关于postgresql - 设置 : The program 'pg_config' is required but it could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45090546/

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