0

我跑了bundle update(这样我就可以安装rails),但是得到了这个错误:

$ bundle update
..... < other stuff ....>
Installing pg (0.14.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/user/.rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
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.

我是新手,Ruby这一切,谁能告诉我这里有什么问题?这是在 OSX 上

4

1 回答 1

2

确保首先安装 postgres。我建议您通过Mac 包管理器homebrew来执行此操作。

brew install postgresql

这是有关如何在 Mac 上安装 postgres 的众多教程之一。

编辑

看起来 gem 找不到您的 postgres 配置,这是与您的问题类似的答案:

https://stackoverflow.com/a/9669523/277370

于 2013-02-13T19:04:13.800 回答