我使用 XAMPP 作为 PostgreSQL 9.3 的安装文件夹。
C:\xampp\pgsql\9.3
现在我尝试使用该目录作为参考来安装 PostgreSQL gem:
gem install pg -- --with-pg-include="C:\xampp\pgsql\9.3\include" --with-pg-lib="C:\xampp\pgsql\9.3\lib" --with-pg-config="C:\xampp\pgsql\9.3\bin\pg_config"
但该命令失败并出现以下错误:
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
C:/Ruby/Ruby200/bin/ruby.exe extconf.rb --with-pg-include=C:\xampp\pgsql\9.3
\include --with-pg-lib=C:\xampp\pgsql\9.3\lib --with-pg-config=C:\xampp\pgsql\9.
3\bin\pg_config
Using config values from C:\xampp\pgsql\9.3\bin\pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Cant find the PostgreSQL client library (libpq)
*** 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:/Ruby/Ruby200/bin/ruby
--with-pg
--without-pg
--with-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include=${pg-dir}/include
--with-pg-lib=${pg-dir}/
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/pg-0
.17.1 for inspection.
Results logged to C:/Ruby/Ruby200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0
.0/pg-0.17.1/gem_make.out
当我检查 pgsql 内部时,实际上有一个名为库文件代替
C:\xampp\pgsql\9.3\lib
那么为什么错误说找不到 PostgreSQL 客户端库 (libpq) 呢?
对于这个错误有什么解决办法吗?
仅供参考,我正在使用:
- Windows 8.1 64 位
- 红宝石 2.0.0 64 位
- 导轨 4.1.1
- 开发套件 4.7.2 64 位
- PostgreSQL 9.3.4 64 位
我正在尝试安装 PG Gem 版本 0.17.1
作为评论的后续,看起来你必须使用32-bit
Windows 上的 Postgres。
这很可能与这样的想法有关:pg
宝石与mingw32
,虽然我不完全确定
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)