我想为 Heroku 构建一个 Rails 3 应用程序。他们使用 Postgres 作为他们的数据库,所以我通过 MacPorts 安装了 postgres 9.0。现在我需要一个 postgres gem,并且一致认为出于性能原因你想要 pg gem。但是,当我尝试通过 rvm 下的 gem install 安装 pg 时遇到的错误让我完全感到困惑。
我非常明确地指定了所有 postgres 目录的位置,但仍然无法完成安装:
$ env ARCHFLAGS='-arch x86_64' gem install pg -- \
--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/postgresql.conf \
--with-pg-include=/opt/local/include/postgresql90/ \
--with-pg-lib=/opt/local/lib/postgresql90/
Using config values from /opt/local/var/db/postgresql90/defaultdb/postgresql.conf
*** 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/guy/.rvm/ruby-1.9.2-p136/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include=${pg-dir}/include
--with-pg-lib=${pg-dir}/lib
--with-pg-config
extconf.rb:24:in ``': Exec format error - /opt/local/var/db/postgresql90/defaultdb/postgresql.conf --includedir (Errno::ENOEXEC)
from extconf.rb:24:in `<main>'
有人有什么想法吗?我很困惑。盖伊