难以使用Mac Postgres App捆绑pg

时间:2013-11-06 13:23:25

标签: macos postgresql gem bundle pg

我尝试在我的Mac上捆绑我的Rails应用程序。在家里它工作正常,我已经设法解决它以前自己,但这次无论我尝试什么,似乎没有什么似乎正在努力解决它。

运行bundle / bundle install时收到的错误如下:

  

安装pg(0.17.0)   Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展。

/Users/notrab/.rbenv/versions/2.0.0-p0/bin/ruby extconf.rb
     

检查pg_config ...不   没有pg_config ...无论如何都要尝试。如果建筑失败,请再试一次    --with-PG-配置= /路径/到/ pg_config   检查libpq-fe.h ...没有   找不到'libpq-fe.h标头    * extconf.rb失败*   由于某些原因无法创建Makefile,可能缺少必要的   库和/或标题。检查mkmf.log文件以获取更多详细信息。你可以   需要配置选项。

     

提供配置选项:     --with-OPT-DIR     --without-OPT-DIR     --with-OPT-包括     --without-OPT-包括= $ {停用DIR} /包括     --with-OPT-LIB     --without-OPT-LIB = $ {选择-DIR} / lib目录     --with-MAKE-PROG     --without-MAKE-PROG     --srcdir =。     --curdir     --ruby = /用户/ notrab / .rbenv /版本/ 2.0.0-P0 /斌/红宝石     --with-PG     --without-PG     --with-PG-配置     --without-PG-配置     --with-pg_config     --without-pg_config     --with-PG-DIR     --without-PG-DIR     --with-PG-包括     --without-PG-包括= $ {PG-DIR} /包括     --with-PG-LIB     --without-PG-LIB = $ {PG-DIR} /

     

Gem文件将保留在/Users/notrab/Sites/Integrity/vendor/bundle/gems/pg-0.17.0中进行检查。

     

结果记录到/Users/notrab/Sites/Integrity/vendor/bundle/gems/pg-0.17.0/ext/gem_make.out

     

安装pg(0.17.0)时发生错误,Bundler无法继续。   在捆绑之前确保gem install pg -v '0.17.0'成功。

我显然已经尝试过了

  

gem install pg -v'0.17.0'并且它说它成功但捆绑再次显示同样的错误。

我也尝试过运行

  

gem install pg - --with-pg-config = / Applications / Postgres.app / Contents / MacOS / bin / pg_config

文档http://postgresapp.com/documentation中概述了这一点,但是当我尝试捆绑时会出现同样的错误。

我绕圈而且不知道如何解决它。

我的Gemfile看起来像:

group :development, :test do
    gem "better_errors"
    gem 'meta_request'
    gem 'binding_of_caller'
    gem 'sqlite3'
end

group :production do
    gem 'pg'
end

非常感谢,

杰米

1 个答案:

答案 0 :(得分:11)

您是否尝试将export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"添加到.bash_profile