【发布时间】:2013-11-17 18:14:24
【问题描述】:
我尝试在工作时将我的 Rails 应用程序捆绑到我的 Mac 上。在家里它工作得很好,我之前已经自己解决了它,但是这次无论我尝试什么似乎都没有解决它。
我在运行 bundle/bundle install 时收到的错误如下:
安装 pg (0.17.0) Gem::Installer::ExtensionBuildError: ERROR: 未能构建 gem 原生扩展。
/Users/notrab/.rbenv/versions/2.0.0-p0/bin/ruby extconf.rb正在检查 pg_config... 否 没有 pg_config... 无论如何都在尝试。如果构建失败,请重试 --with-pg-config=/path/to/pg_config 检查 libpq-fe.h... 否 找不到'libpq-fe.h 标头 * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。
提供的配置选项: --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 --没有-make-prog --srcdir=。 --curdir --ruby=/Users/notrab/.rbenv/versions/2.0.0-p0/bin/ruby --with-pg --没有-pg --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --没有-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --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
非常感谢,
杰米
【问题讨论】:
-
试试这个.. xcode-select --install
-
遗憾的是,这给了我来自软件更新服务器的错误。
-
确保您的互联网连接正常。
标签: macos postgresql gem bundle pg