【问题标题】:I can't install Ruby Gem 'curb' on Mac OS Lion我无法在 Mac OS Lion 上安装 Ruby Gem 'curb'
【发布时间】:2012-02-22 08:32:15
【问题描述】:

我正在尝试捆绑安装一个应用程序,但它一直卡在路边宝石上。这是 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'

有什么想法吗?

【问题讨论】:

    标签: ruby gem curb


    【解决方案1】:

    由于XCode4没有使用gcc-4.2,所以很多库安装失败。

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

    如何做到这一点:

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

    祝你好运

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 我已经安装了 xcode。至少我认为我有。我可以打开 xcode 应用程序,甚至开始使用它。这是否意味着它已安装?奇怪的问题,我知道,但是在我寻找答案的过程中,我发现了一些帖子,说你必须安装它,但上述事实以及当我在应用商店中查看它时它出现的安装表明它确实是已经安装了。
      • 可能与需要确保在安装时检查“unix 开发支持”有关? stackoverflow.com/questions/2685887/…
      • 感谢您的回复。您链接到的问题是该人从 cd 安装的情况。我直接从 App Store 安装...没有选择或复选框来选中或取消选中的选项。它只是安装了,就是这样。
      猜你喜欢
      • 1970-01-01
      • 2017-12-17
      • 2011-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多