在 osx 上安装 pg gem 时出错

编程入门 行业动态 更新时间:2024-10-27 22:28:58
本文介绍了在 osx 上安装 pg gem 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 osx 10.6.7 上尝试在新的 rails 3.0.7 应用程序上运行 bundle install,但在尝试构建 pg gem 时它一直失败.它一直告诉我我需要开发人员工具.但据我所知,我已经安装了开发者工具.

I am on osx 10.6.7 trying to run bundle install on a new rails 3.0.7 app and it keeps failing when trying to build the pg gem. It keeps telling me that I have need the developer tools. But as far as I can tell I have the developer tools installed.

这是 xcodebuild -version 的输出

Here is the output of xcodebuild -version

Xcode 3.2.6 Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 BuildVersion: 10M2518

这是失败的 pg gem 构建的输出

Here is the output of the failed pg gem build

/Users/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config Using config values from /Library/PostgreSQL/8.4/bin/pg_config checking for libpq-fe.h... *** 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 --without-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/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:852:in `find_header' from extconf.rb:31:in `<main>' Gem files will remain installed in /Users/bm/.rvm/gems/ruby-1.9.2-head@rc_search/gems/pg-0.11.0 for inspection. Results logged to /Users/bm/.rvm/gems/ruby-1.9.2-head@rc_search/gems/pg-0.11.0/ext/gem_make.out from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions' from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `block in run' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `block in each' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/gems/bundler-1.0.0/bin/bundle:13:in `<top (required)>' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/bin/bundle:19:in `load' from /Users/bm/.rvm/gems/ruby-1.9.2-head@global/bin/bundle:19:in `<main>'

任何帮助将不胜感激.仅供参考,我还尝试使用 mysql 构建应用程序,并且基本上得到了相同的堆栈.所以我很确定我错过了某种开发人员构建工具,但我只是不知道哪些.:(

Any help would be immensely appreciated. FYI I also tried building the app with a mysql and essentially got the same stack. So I'm pretty sure I'm missing some sort of developer build tools, but I just don't know which ones. :(

推荐答案

  • export ARCHFLAGS='-arch x86_64'
  • 导出 PATH=/Library/PostgreSQL/9.1/bin:${PATH}
  • gem 安装 pg
  • 更多推荐

    在 osx 上安装 pg gem 时出错

    本文发布于:2023-10-13 20:19:17,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1488980.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:osx   pg   gem

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!