我能';t安装Ruby Gem';路缘石';关于Mac OS Lion

我能';t安装Ruby Gem';路缘石';关于Mac OS Lion,ruby,gem,curb,Ruby,Gem,Curb,我正试图捆绑安装一个应用程序,但它总是卡在路边。以下是文件: source :rubygems gem 'sinatra', '~>1.0' gem 'yajl-ruby', '~>0.7.8' gem 'mustache', '~>0.11.2' gem 'curb', '~>0.7.8' gem 'coderay', '~>0.8.357' gem 'sinatra_auth_github' group :test do gem '

我正试图捆绑安装一个应用程序,但它总是卡在路边。以下是文件:

source :rubygems

gem 'sinatra',   '~>1.0'
gem 'yajl-ruby', '~>0.7.8'
gem 'mustache',  '~>0.11.2'
gem 'curb',      '~>0.7.8'
gem 'coderay',   '~>0.8.357'

gem 'sinatra_auth_github'

group :test do
  gem 'shotgun'
end
下面是错误:

steven-gallaghers-macbook-pro:hurl sgallagher$ bundle install
Fetching gem metadata from http://rubygems.org/...........
Fetching gem metadata from http://rubygems.org/..
Using addressable (2.2.2) 
Using coderay (0.8.357) 
Installing curb (0.7.8) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/sgallagher/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /Users/sgallagher/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
"$(cflags)  -fno-common -pipe"
checking for curl-config... yes
checking for curlinfo_redirect_time... *** 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
    --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/sgallagher/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
    --with-curl-dir
    --without-curl-dir
    --with-curl-include
    --without-curl-include=${curl-dir}/include
    --with-curl-lib
    --without-curl-lib=${curl-dir}/lib
/Users/sgallagher/.rvm/rubies/ruby-1.9.2-p290/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/sgallagher/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:446:in `try_compile'
    from extconf.rb:52:in `block in have_constant'

有什么想法吗?

您需要安装xcode才能获得OS X开发库。

由于xcode 4不使用gcc-4.2,有许多库无法安装

您必须从开发人员中心安装XCode3,它将为您创建gcc-4.2

如何做到这一点:

  • 注册为开发者(免费)
  • 下载并确保您确实安装了XCode3
  • 检查gcc-4.2文件

  • 祝你好运

    我已经安装了xcode。至少我认为我有。我可以打开xcode应用程序,甚至开始使用它。这是否意味着它已安装?我知道这是个奇怪的问题,但在我寻找答案的过程中,我看到一些帖子说你必须安装它,但上面的事实以及当我在app store中查看它时,它显示为已安装,这表明它确实已经安装。可能与安装时需要确保检查“unix开发支持”有关?谢谢你的回复。你链接到的问题有一种情况,那家伙是从cd安装的。我是直接从应用商店安装的…没有可选择的选项,也没有可选中或取消选中的复选框。它只是简单地安装了,就这样。