【发布时间】:2013-12-12 00:47:51
【问题描述】:
我正在尝试在我的本地计算机上安装 pg gem 以与 Postgres.app 一起使用。我正在经营小牛队。
Postgres.app 已安装并运行良好,但我无法让 gem 工作。我做了以下事情:
- 使用 Postgres.app 文档中的命令 'env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config'
- 更新了 Homebrew 并安装了 Apple GCC 4.2
- 安装了 Xcode 开发者工具
- 更新了我的 $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}/
如果您能提供任何帮助,我将不胜感激。谢谢!
【问题讨论】:
标签: ruby-on-rails macos postgresql osx-mavericks pg