gpt4 book ai didi

ruby-on-rails - 在 Windows 上的 rail 上安装 postgres gem 时出错

转载 作者:行者123 更新时间:2023-11-29 13:57:14 25 4
gpt4 key购买 nike

我正在学习在 Windows 8.1 上使用 ruby​​ on rails。当我必须安装 pg(postgres) gem 时,我卡住了。具体来说,这是错误:

错误:安装 pg 时出错:

   Error: failed to build gem natve extension
C:/Rails Installer/Ruby2.1.0/bin/ruby.exe extconf.rb
checking for pg_config... no
No pg_confg... trying anyway. If build fails, please try again with --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
can't find the 'libpq-fe.h header
*** 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.

我被卡住了,任何建议都会有所帮助。谢谢

最佳答案

尝试使用 Windows 命令行工具确定 pg_config 的位置(来源:https://superuser.com/questions/49104/how-do-i-find-the-location-of-an-executable-in-windows):

where pg_config

复制返回的路径并使用

bundle config build.pg --with-pg-config=/path/found/for/pg_config

(基于 ERROR: Failed to build gem native extension on Mavericks )

关于ruby-on-rails - 在 Windows 上的 rail 上安装 postgres gem 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29518357/

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