错误:无法在rubygem安装上构建gem本机扩展

时间:2014-07-27 11:08:47

标签: ruby rubygems homebrew rbenv

在尝试执行#34;捆绑安装"时,我收到错误消息

  

环境= OSX 10.9.4 rbenv 0.4.0 ,    ruby​​ 2.1.2 ,   自制语0.9.5

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/hirotakagotanda/.rbenv/versions/2.1.2/bin/ruby extconf.rb 
*** 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/hirotakagotanda/.rbenv/versions/2.1.2/bin/ruby
/Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `stat': No such file or directory @ rb_file_s_stat - ./212/ruby_debug.h (Errno::ENOENT)
    from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
    from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1587:in `fu_each_src_dest0'
    from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
    from /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/2.1.0/fileutils.rb:399:in `cp'
    from extconf.rb:83:in `block in <main>'
    from extconf.rb:82:in `each'
    from extconf.rb:82:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/debugger-1.6.6 for inspection.
Results logged to /Users/hirotakagotanda/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/debugger-1.6.6/gem_make.out
An error occurred while installing debugger (1.6.6), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.6'` succeeds before bundling.

任何人都可以请我解决方案,我不幸发现任何......

3 个答案:

答案 0 :(得分:0)

这可能是Xcode命令行工具的一个问题。要做到这一点,还需要采取一些措施。

这个问题Installing Ruby Debug IDE Gem提供了一个例子。

答案 1 :(得分:0)

我遇到了同样的问题,并通过同意xcode的许可来解决了这个问题(这似乎发生在更新之后,你还没有同意更新)

只需从命令行运行xcodebuild -license

感谢this问题

找到了答案

答案 2 :(得分:0)

以上评论都没有帮助我。改为下面的ruby 2.1.1允许我捆绑而没有问题。

rbenv local 2.1.1
bundle install

使用ruby 2.1.2,它在同一个地方打破

相关问题