安装ruby debug19。编译器无法生成可执行文件

时间:2012-07-30 22:09:51

标签: ruby-on-rails ruby

我正在尝试安装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>'

2 个答案:

答案 0 :(得分:3)

我遇到了类似的问题,但是安装了nokogiri gem,我解决了以下问题:

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

请参阅Bundle update & install fail after OS X lion upgrade - Rails 3

答案 1 :(得分:0)

请改用调试器gem。 ruby-debug19从未长大,不支持ruby1.9.3