Ruby on rails 无法在windows中安装pg gem
在windows中安装pg gem时出现以下错误。 使用的命令:$gem安装pg--with pg=S: ****输出:****Ruby on rails 无法在windows中安装pg gem,ruby-on-rails,Ruby On Rails,在windows中安装pg gem时出现以下错误。 使用的命令:$gem安装pg--with pg=S: ****输出:**** Building native extensions with: '-- with-pg=S:' This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. c:/RailsInstaller/Ruby
Building native extensions with: '-- with-pg=S:'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb -- with-pg=S:
checking for pg_config... yes
Using config values from S:/bin/pg_config.exe
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
Can't 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:/RailsInstaller/Ruby2.1.0/bin/ruby
--with-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--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
--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:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/pg-0.18.4 for inspection.
Results logged to c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/pg-0.18.4/gem_make.out
通过谷歌搜索,我发现我们应该安装“apt-get-install-libpq-dev”。有人能告诉我如何在windows机器上实现这一点吗
如果我尝试“gem安装libpq-dev”,我会发现下面的错误
错误:在任何存储库中都找不到有效的gem“libpq dev”(>=0)
错误:可能的备选方案:libevdev、libpixel
有人能告诉我如何在windows机器上实现这一点吗
Windows对待库的方式不同于Linux
/Mac
;没有像apt-get
或brew
这样的存储库(尽管正在取得进展)。。。您必须自己下载LIB并直接引用它们
Download the PGSQL binary: http://www.enterprisedb.com/products-services-training/pgbindownload
gem install pg -- --with-pg-dir="C:\Path\To\PostgreSQL\9.5"
有人能告诉我如何在windows机器上实现这一点吗
Windows对待库的方式不同于Linux
/Mac
;没有像apt-get
或brew
这样的存储库(尽管正在取得进展)。。。您必须自己下载LIB并直接引用它们
Download the PGSQL binary: http://www.enterprisedb.com/products-services-training/pgbindownload
gem install pg -- --with-pg-dir="C:\Path\To\PostgreSQL\9.5"
试试看,这会管用的
sudo apt-get install -y libpq-dev build-essential postgresql-server-dev-all libpgsql-ruby postgresql ruby-dev && gem install pg
试试这个会有用的
sudo apt-get install -y libpq-dev build-essential postgresql-server-dev-all libpgsql-ruby postgresql ruby-dev && gem install pg
Windows不支持
libpq-dev
Windows不支持libpq-dev
我已经在c驱动器中找到了二进制文件,并在前面尝试了此命令。但是运气不好。正如你提到的,我再次从你在D驱动器中提供的源代码下载,并在下面的命令中执行。$gem install pg--with pg dir=“D:\pgsql”我必须卸载64位的pgsql并重新安装32位的pgsql。现在它成功了。感谢您的输入。我已经在c驱动器中找到了二进制文件,并在前面尝试了这个命令。但是运气不好。正如你提到的,我再次从你在D驱动器中提供的源代码下载,并在下面的命令中执行。$gem install pg--with pg dir=“D:\pgsql”我必须卸载64位的pgsql并重新安装32位的pgsql。现在它成功了。谢谢你的意见。