2

我正在尝试安装 ruby​​ debug 19,以便可以运行 spork。尽管这非常令人沮丧,但我遇到了错误。我用谷歌搜索了一段时间无济于事。我正在运行 1.9.3-p194。

这是错误消息:

构建原生扩展。这可能需要一段时间... 错误:安装 ruby​​-debug19 时出错:错误:无法构建 gem 原生扩展。

    /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.body 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
--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/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/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/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1002:in `block in have_struct_member'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/jasonvdm/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1001:in `have_struct_member'
from extconf.rb:10:in `block in <main>'
from /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:24:in `<main>'
4

2 回答 2

3

我遇到了类似的问题,但是在安装nokogirigem 时,我用以下方法解决了它:

cd /usr/bin
sudo ln -s llvm-gcc-4.2 gcc-4.2

请参阅OS X lion 升级后捆绑更新和安装失败 - Rails 3

于 2012-10-17T20:47:43.927 回答
0

请改用调试器 gem。ruby-debug19 从不支持 ruby​​1.9.3

于 2012-07-31T06:14:57.860 回答