我无法在Mac OS Lion上安装Ruby Gem'curb'

时间:2012-02-21 22:14:53

标签: ruby gem curb

我正在尝试捆绑安装一个应用程序,它一直停留在curb gem。这是Gemfile:

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'

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

由于XCode4不使用gcc-4.2,因此无法安装许多库。

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

如何做到这一点:

  1. 注册为开发人员(免费)
  2. 下载并确保您确实安装了XCode3
  3. 检查gcc-4.2文件
  4. 祝你好运