无法安装pg gem
我尝试使用
gem install pg
但它似乎不起作用。
gem install pg
给出了这个错误
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building 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. 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/bin/ruby
--with-pg
--without-pg
--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-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/pg-0.10.1 for
inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/pg-0.10.1/ext/gem_make.out
没有找到相关结果
已邀请:
20 个回复
马口
乏摩纶誊伟
瞥同忙接
坊岔埠绵
babsoft
传递给您的gem安装。 更重要的是,你只需要
来安装它。 在Mac上 如果你有机会通过mac上的网站捆绑软件安装了postgres,那么它将会出现在像
这样的地方。 所以,要么你在gem安装上传递它:
或者您正确设置PATH。由于这可能太多,暂时设置PATH:
芜任亮蜡
在Ubuntu 12.04上。 这解决了它。 更新: 使用最新版本:
漂汀拦
刷遍派戳
,然后编辑你的
或
文件或同等文件并添加:
那么
和
都应该按预期工作。
氏脑
将9.1替换为系统上安装的版本。
掀辟髓观粟
到街客核
烫珊
标志一起使用。
这解决了您遇到的同样问题。
肺鬼耙扮群
臀夯脖锑
这应该可以解决问题
死搭胯
的日志文件以查看发生的情况,而不是盲目地安装内容。 就我而言,MAC OS,日志文件在这里:
日志表明由于以下原因无法创建make文件:
在mkmf.log中,您将看到无法找到所需的库,以完成构建。
运行
后,我可以看到所有必需的库存在:
钾涎净介
一直导致问题,因为我不能强迫它使用特定的PG版本。 我也不能
,因为依赖问题(它会删除php,http等) 解决方案? Mess $ PATH暂时优先使用更新pgsql而不是默认值:
基本上,使用上面的命令,它将在
之前看到
填盖
栖很钾是狠
那么
祁澈盘哼颗
降女陷费券
要点:https://gist.github.com/sharnie/5588340cf023fb177c8d