【问题标题】:gem install stopped working after upgrade to OS X 10.10 Yosemite升级到 OS X 10.10 Yosemite 后 gem install 停止工作
【发布时间】:2014-10-18 01:16:20
【问题描述】:

我升级到 OS X Yosemite,gem install 停止工作。

当我运行它时,我看到了这个丑陋的大错误:

$  gem install rdiscount
Building native extensions.  This could take a while...
ERROR:  Error installing rdiscount:
    ERROR: Failed to build gem native extension.

    ruby -r ./siteconf.rb extconf.rb
checking for random()... *** 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=ruby
    --with-rdiscount-dir
    --without-rdiscount-dir
    --with-rdiscount-include
    --without-rdiscount-include=${rdiscount-dir}/include
    --with-rdiscount-lib
    --without-rdiscount-lib=${rdiscount-dir}/
mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from mkmf.rb:513:in `block in try_link0'
    from tmpdir.rb:88:in `mktmpdir'
    from mkmf.rb:510:in `try_link0'
    from mkmf.rb:534:in `try_link'
    from mkmf.rb:720:in `try_func'
    from mkmf.rb:1004:in `block in have_func'
    from mkmf.rb:895:in `block in checking_for'
    from mkmf.rb:340:in `block (2 levels) in postpone'
    from mkmf.rb:310:in `open'
    from mkmf.rb:340:in `block in postpone'
    from mkmf.rb:310:in `open'
    from mkmf.rb:336:in `postpone'
    from mkmf.rb:894:in `checking_for'
    from mkmf.rb:1003:in `have_func'
    from extconf.rb:5:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in rdiscount-2.1.7.1 for inspection.
Results logged to /gem_make.out

【问题讨论】:

    标签: ruby macos gem osx-yosemite


    【解决方案1】:

    当您升级到 Yosemite 时,Xcode 命令行工具将变得不可用。

    运行此命令,然后按照屏幕上的说明进行操作。

    $  xcode-select --install
    xcode-select: note: install requested for command line developer tools
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-24
      • 2014-12-15
      • 2015-03-21
      • 2014-12-24
      • 1970-01-01
      • 2014-12-25
      • 1970-01-01
      • 2014-12-15
      相关资源
      最近更新 更多