Ruby Can';t构建gem本机扩展
我不太清楚为什么,但我似乎无法安装任何涉及构建本机扩展的gem。有人能建议如何开始调试这个问题吗?下面是我通过Ruby Can';t构建gem本机扩展,ruby,gem,bundler,Ruby,Gem,Bundler,我不太清楚为什么,但我似乎无法安装任何涉及构建本机扩展的gem。有人能建议如何开始调试这个问题吗?下面是我通过gem安装调试器获得的输出 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb checking for rb_method_entry_
gem安装调试器获得的输出
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... *** 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/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1002:in `block in have_struct_member'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1001:in `have_struct_member'
from extconf.rb:34:in `block in <main>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `call'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `create_makefile_with_core'
from extconf.rb:87:in `<main>'
Gem files will remain installed in /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0 for inspection.
Results logged to /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug/gem_make.out
An error occurred while installing debugger (1.6.0), and Bundler cannot continue.
这对我很有用:
gem update debugger-ruby_core_source
您是否安装了xcode命令行工具?它们在你的路径上吗?它们肯定已经安装好了。我如何检查它们是否在我的路径中?请检查mkmf.log的内容?(gcc是否在您的路径中?您可以通过运行$which gcc进行检查)键入echo$path
以显示路径中的所有内容。如果要检查路径中是否有特定的组件,请键入which gcc
或which make
。如果您这样做时终端没有输出任何内容,则它不在您的路径中。要在路径中添加内容,请执行以下操作:path=$path:/path/To/file/here export path
gcc在我的路径中,知道在哪里可以找到mkmf.log吗@罗杰德帕克
gem update debugger-ruby_core_source