开发者

gem install pg on Windows XP

To my constant consternation I am forced to pro开发者_开发知识库gram on Windows at work. I am trying in vain to install postreSQL for some Ruby development.

ctipton@MIS-PROGRAMMER /c/rubyDev
$ gem install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

c:/Ruby192/bin/ruby.exe extconf.rb
checking for pg_config... yes
*** 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:/Ruby192/bin/ruby
        --with-pg
        --without-pg
        --with-pg-config
        --without-pg-config
extconf.rb:33:in ``': No such file or directory - c:\Program Files\PostgreSQL\8.3\bin/pg_config.exe --cflags (Errno::ENOENT)
        from extconf.rb:33:in `<main>'

What it looks like to me is the path it is showing for c:\Program Files...\bin/pg_config.exe has the wrong path seperator. Looking at the extconf.rb it is building that path with

ENV['PATH'] = "#{pgdir}/bin" + File::PATH_SEPARATOR + ENV['PATH']

Where is File::PATH_SEPARATOR defined, why is it incorrect, and is it possible to fix?


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

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.

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.

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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜