无法获取postgresql数据库来查找pg_config文件

时间:2015-02-16 05:09:24

标签: postgresql config pg

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/markhoyt/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.1/bin/pg_config
Using config values from /usr/pgsql-9.1/bin/pg_config
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
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/markhoyt/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-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}/

 extconf failed, exit code 1

 Gem files will remain installed in    /Users/markhoyt/Desktop/KeyToLife/KeyToLife/KEYTOLIFEPG/KeyToLifeApp/vendor/bundle/ruby/2.0.0/gems/pg-0.18.1 for inspection.
 Results logged to /Users/markhoyt/Desktop/KeyToLife/KeyToLife/KEYTOLIFEPG/KeyToLifeApp/vendor/bundle    /ruby/2.0.0/extensions/x86_64-darwin-12/2.0.0-static/pg-0.18.1/gem_make.out

我已经在这方面工作了两天,并且已经尝试了从堆栈溢出的所有内容。我已经安装了PG应用程序,试图找到并设置一个带有pg config的路径,但无法正确完成。

 locate pg_config
/usr/local/Cellar/postgresql/9.4.1/bin/pg_config
/usr/local/Cellar/postgresql/9.4.1/include/ecpg_config.h
/usr/local/Cellar/postgresql/9.4.1/include/pg_config.h
/usr/local/Cellar/postgresql/9.4.1/include/pg_config_ext.h
/usr/local/Cellar/postgresql/9.4.1/include/pg_config_manual.h
/usr/local/Cellar/postgresql/9.4.1/include/pg_config_os.h
/usr/local/Cellar/postgresql/9.4.1/include/server/pg_config.h
/usr/local/Cellar/postgresql/9.4.1/include/server/pg_config_ext.h
/usr/local/Cellar/postgresql/9.4.1/include/server/pg_config_manual.h
/usr/local/Cellar/postgresql/9.4.1/include/server/pg_config_os.h
/usr/local/Cellar/postgresql/9.4.1/share/man/man1/pg_config.1
/usr/local/bin/pg_config
/usr/local/include/ecpg_config.h
/usr/local/include/pg_config.h
/usr/local/include/pg_config_ext.h
/usr/local/include/pg_config_manual.h
/usr/local/include/pg_config_os.h
/usr/local/share/man/man1/pg_config.1

任何帮助都会非常感激!

1 个答案:

答案 0 :(得分:0)

你在运行什么操作系统?苹果电脑 ? GNU / Linux?

如果你在MacOS上运行一个不错的选择是Postgres.app(http://postgresapp.com),它可能适合你的需要。它通过各种框架为我提供了完美的工作。

另外,我猜您也检查了头文件? 输出是什么:     找到libpq-fe.h ?