我正在尝试在我的本地机器上安装pg gem以与Postgres.app一起使用。 我正在运行Mavericks操作系统。
Postgres.app已安装并正常运行,但我无法让gem工作。 我已经完成了以下操作:
1. 使用Postgres.app文档中的命令“env ARCHFLAGS =“ -arch x86_64”gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config” 2. 更新Homebrew并安装Apple GCC 4.2 3. 安装Xcode开发人员工具 4. 更新我的$ PATH以引用Postgres.app bin和lib目录
都没有成功。 这是我收到的具体错误消息:
Postgres.app已安装并正常运行,但我无法让gem工作。 我已经完成了以下操作:
1. 使用Postgres.app文档中的命令“env ARCHFLAGS =“ -arch x86_64”gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config” 2. 更新Homebrew并安装Apple GCC 4.2 3. 安装Xcode开发人员工具 4. 更新我的$ PATH以引用Postgres.app bin和lib目录
都没有成功。 这是我收到的具体错误消息:
Building native extensions with: '--with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/Brian/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/MacOS/bin/pg_config
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
sh: /Applications/Postgres.app/Contents/MacOS/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
--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/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
--with-pg
--without-pg
--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}/
我很感激你所提供的任何帮助。谢谢!