【发布时间】:2014-08-05 14:46:50
【问题描述】:
按照 Heroku 网站上的说明,我安装了Postgress.app,安装了pg gem,安装了data_mapper,一切都很顺利。最后,尝试安装 dm-sqlite-adapter 并得到了这个:
sudo gem install dm-postgres-adapter
Fetching: data_objects-0.10.14.gem (100%)
Successfully installed data_objects-0.10.14
Fetching: do_postgres-0.10.14.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing dm-postgres-adapter:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... yes
checking for mb/pg_wchar.h... no
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14/ext/do_postgres/gem_make.out
我也试过了
sudo ARCHFLAGS="-arch x86_64" gem install dm-postgres-adapter
但结果相同。
我查看了 gem_make.out 并在其末尾发现以下内容:
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
有什么建议可以尝试吗?
【问题讨论】:
-
我安装了 Postgres.app。这是在 Mac 上安装 PostgreSQL 的一种方式。挖掘安装的子文件夹,我可以找到报告丢失的文件,所以我尝试使用各种选项,如
sudo ARCHFLAGS="-arch x86_64" gem install dm-postgres-adapter -- --with-pgsql-server-include=/Applications/Postgres.app/Contents/Versions/9.3/include/postgresql/server,但到目前为止没有成功。 -
试图找出在哪里可以找到它。
-
嗯,我找到了...但它并没有真正的帮助。它表明所有的头文件实际上都找到了,但是有一堆解析错误,像这样:
/Applications/Postgres.app/Contents/Versions/9.3/include/postgresql/server/mb/pg_wchar.h:542:28: error: function cannot return function type 'bool' (aka 'int (int *)') extern bool pg_utf8_islegal(const unsigned char *source, int length); ^ 2 warnings and 15 errors generated.
标签: ruby postgresql sinatra