ruby-on-rails – 在osx上安装pg gem时出错

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 在osx上安装pg gem时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在osx 10.6.7试图运行捆绑安装在一个新的rails 3.0.7应用程序,它一直在失败,当尝试构建pg宝石.它一直告诉我,我需要开发工具.但是据我所知,我已经安装了开发人员工具.

这是xcodebuild -version的输出

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

以下是失败的pg gem构建的输出

/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构建应用程序,并且基本上得到相同的堆栈.所以我很确定我错过了一些开发人员构建工具,但是我不知道哪些工具. 原文链接:https://www.f2er.com/ruby/273163.html

猜你在找的Ruby相关文章