【发布时间】:2016-08-19 02:13:54
【问题描述】:
使用 PostgreSQL 9.5.4 开发新的 Ruby on Rails 5.0 应用程序。尝试安装 pg gem 时遇到问题
捆绑安装失败,因为它似乎无法找到 pg_config 并且在尝试构建本机扩展时出错。
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
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=/Users/brian.hooper/.rbenv/versions/2.3.0/bin/$(RUBY_BASE_NAME)
--with-pg
--without-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
To see why this extension failed to compile, please check the mkmf.log
【问题讨论】:
标签: ruby-on-rails postgresql pg