无法在 Windows 上安装 pg gem [英] Can't install pg gem on Windows

查看:21
本文介绍了无法在 Windows 上安装 pg gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 2 个 Ruby 版本:1.8.7 和 1.9.2 以及 PostgreSQL 8.3.我无法在其中任何一个上安装 pg gem.收到此错误:

I've got 2 Ruby versions: 1.8.7 and 1.9.2 and PostgreSQL 8.3. I cant install pg gem on any of them. Getting this error:

C:/Development/Ruby187/bin/ruby.exe extconf.rb
checking for pg_config... yes
not recorded
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.  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=C:/Development/Ruby187/bin/ruby
 --with-pg
 --without-pg
 --with-pg-config
 --without-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}/lib

我知道这是一个常见问题,但我还没有找到任何可行的解决方案...哦,我已将 C:Program Files (x86)PostgreSQL8.3in 添加到我的 PATH 中.

I know it's a common problem, but I haven't found any working solution yet... Oh, I have added C:Program Files (x86)PostgreSQL8.3in to my PATH.

推荐答案

您收到的消息清楚地表明您缺少正确安装该 gem 的东西:

The message you're getting is a clear indication that you lack something for the correct installation of that gem:

由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.查看 mkmf.log 文件了解更多信息细节.您可能需要配置选项.

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.

昨天发布的最新版本 pg (0.10.0) 没有 Windows 本机版本,但如果您安装 0.9.0,它应该可以毫无问题地安装二进制文件.

There is no Windows native version of latest release of pg (0.10.0) released yesterday, but if you install 0.9.0 it should install binaries without issues.

无论如何,如果你想安装 gem,你需要安装一个构建环境.如果您使用的是 RubyInstaller,那么您需要 DevKit

Anyhow, if you want to install the gem, you need a build environment installed. If you're using RubyInstaller, then you need the DevKit

gem 的安装只需要您为 gem 安装提供额外的选项(如 --with-pg-dir)

Installation of the gem will only require you provide additional options to gem installation (like --with-pg-dir)

subst X: "C:Program Files (x86)PostgreSQL8.3"
gem install pg -- --with-pg-dir=X:
subst X: /D

这篇关于无法在 Windows 上安装 pg gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆