Can';t安装ruby调试,错误:rb\u方法\u条目\u t.called\u id

Can';t安装ruby调试,错误:rb\u方法\u条目\u t.called\u id,ruby,ruby-1.9.3,ruby-debug,Ruby,Ruby 1.9.3,Ruby Debug,我正在尝试安装ruby调试。我使用的是MacOS10.7.4、XCode版本2308和Ruby版本1.9.3-p194 按照此处的说明:,我尝试运行 sudo gem install ruby-debug 我得到了以下错误: Building native extensions. This could take a while... ERROR: Error installing ruby-debug: ERROR: Failed to build gem native exten

我正在尝试安装ruby调试。我使用的是MacOS10.7.4、XCode版本2308和Ruby版本1.9.3-p194

按照此处的说明:,我尝试运行

sudo gem install ruby-debug
我得到了以下错误:

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug:
    ERROR: Failed to build gem native extension.

        /Users/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** 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/andrew/.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
extconf.rb:16:in `block in <main>': break from proc-closure (LocalJumpError)
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:32:in `<main>'


Gem files will remain installed in /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26 for inspection.
Results logged to /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26/ext/ruby_debug/gem_make.out
这导致:

Fetching: columnize-0.3.6.gem (100%)
Fetching: debugger-ruby_core_source-1.1.3.gem (100%)
Fetching: debugger-linecache-1.1.1.gem (100%)
Building native extensions. This could take a while...
Fetching: debugger-1.1.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed columnize-0.3.6
Successfully installed debugger-ruby_core_source-1.1.3
Successfully installed debugger-linecache-1.1.1
Successfully installed debugger-1.1.4
4 gems installed
Installing ri documentation for columnize-0.3.6...
Installing ri documentation for debugger-ruby_core_source-1.1.3...
Installing ri documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing ri documentation for debugger-1.1.4...
Installing RDoc documentation for columnize-0.3.6...
Installing RDoc documentation for debugger-ruby_core_source-1.1.3...
Installing RDoc documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing RDoc documentation for debugger-1.1.4...
所以我研究了这个问题,最后发现了这篇文章:

在我尝试命令之前,一切正常:

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p194
这只是复制了上面的第一个错误。所以我调查了一下

rb_method_entry_t.called_id
并找到了以下帖子:

我尝试了他的建议步骤,除了rehash(我不知道如何使用rvm,也不想切换到rbenv只是为了尝试)。我将他推荐的所有gems下载到一个文件夹中,并运行以下命令:

gem install *.gem -- --with-ruby-include=$(echo ~/.rvm/rubies/1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194/) --no-rdoc --no-ri
它很好地安装了linecache19-0.5.13,但在ruby-debug-base19-0.11.26.gem上被阻塞,再次产生第一个错误

我还尝试卸载运行sudogem安装调试器时添加的调试器gems,但这并没有改变任何事情


我不知道下一步该怎么做。

ruby 1.9的ruby调试失败,请尝试一下“pry”。也许可以让ruby调试工作,但我不会指望它


我知道这个问题已经很老了,但我今天也犯了同样的错误,这是我搜索错误时的第一个结果

对我来说,调试器作为依赖项安装并正在运行

gem install debugger

在修理它之前

刚刚在通过RVM安装Ruby 2.0.0时遇到了这个问题

如果二进制文件可用,RVM将只随二进制文件一起安装,这会更快,但调试器也需要源代码

rvm reinstall 2.0.0 --disable-binary

一般来说,在使用rvm时不应该使用sudo,尽管我认为这与您的问题无关。是的,我几周前切换到pry,它工作得非常出色。
rvm reinstall 2.0.0 --disable-binary