Ruby on rails 在windows上安装postgres gem on rail时出错

Ruby on rails 在windows上安装postgres gem on rail时出错,ruby-on-rails,windows,postgresql,gem,pg,Ruby On Rails,Windows,Postgresql,Gem,Pg,我正在学习在Windows8.1上使用RubyonRails。当我不得不安装pg(postgres)gem时,我被卡住了。具体来说,这是一个错误: 错误:安装pg时出错: Error: failed to build gem natve extension C:/Rails Installer/Ruby2.1.0/bin/ruby.exe extconf.rb checking for pg_config... no No pg_confg... trying anyway. I

我正在学习在Windows8.1上使用RubyonRails。当我不得不安装pg(postgres)gem时,我被卡住了。具体来说,这是一个错误:

错误:安装pg时出错:

   Error: failed to build gem natve extension
   C:/Rails Installer/Ruby2.1.0/bin/ruby.exe extconf.rb
  checking for pg_config... no
No pg_confg... trying anyway. If build fails, please try again with --with-pg-config=/path/to/pg_config
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.

我被卡住了,任何建议都会有帮助。谢谢

尝试使用Windows命令行工具(源代码:)识别
pg_config
的位置:

复制返回的路径并使用它

bundle config build.pg --with-pg-config=/path/found/for/pg_config

(基于)

您是否尝试重新安装pg?我尝试过,但仍遇到相同的问题。。。请帮助我试图找到pg_配置,但结果是:找不到给定模式的文件,所以我想我必须重新安装Postgres…这是个好主意吗?是的,尝试重新安装ITI,重新安装后,没有任何变化,你建议我现在怎么办?
bundle config build.pg --with-pg-config=/path/found/for/pg_config