无法在Windows上安装pg gem [英] Can't install pg gem on Windows
问题描述
我有两个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:\程序文件(x86)\ PostgreSQL \8.3\bin添加到我的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)\PostgreSQL\8.3\bin to my PATH.
推荐答案
您收到的信息清楚地表明您缺少正确安装该宝石的东西:
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)\PostgreSQL\8.3"
gem install pg -- --with-pg-dir=X:
subst X: /D
这篇关于无法在Windows上安装pg gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!