【问题标题】:Can't install ruby-debug, error: rb_method_entry_t.called_id无法安装 ruby​​-debug,错误:rb_method_entry_t.called_id
【发布时间】:2012-06-27 16:52:32
【问题描述】:

我正在尝试安装 ruby​​-debug。我使用的是 Mac OS 10.7.4、XCode 版本 2308 和 Ruby 版本 1.9.3-p194。

按照此处的说明:http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug,我尝试运行

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

所以我尝试了以下命令:

sudo gem install debugger

导致:

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...

所以我研究了这个问题,最后发现了这个帖子:

how do I install ruby-debug in ruby 1.9.3 / Rails 3.2.1

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

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

发现了这个帖子:https://github.com/ruby/ruby/pull/56/#issuecomment-3463264

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

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 上阻塞,再次产生第一个错误。

我还尝试卸载运行 sudo gem install debugger 时添加的调试器 gem,但这并没有改变任何东西。

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

【问题讨论】:

  • 一般来说,在使用rvm的时候不应该使用sudo,不过我觉得和你的问题没有关系。

标签: ruby ruby-1.9.3 ruby-debug


【解决方案1】:

ruby-debug 对于 ruby​​ 1.9 已损坏,请尝试“pry”。也许可以让 ruby​​-debug 工作,但我不会指望它。

Debugging in ruby 1.9

【讨论】:

  • 是的,我几周前改用 pry,效果很好。
【解决方案2】:

我知道这个问题已经相当老了,但我今天遇到了同样的错误,这是我在谷歌上搜索错误时的第一个结果。

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

gem install debugger

在捆绑之前修复它。

【讨论】:

    【解决方案3】:

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

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

    rvm reinstall 2.0.0 --disable-binary
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-19
      • 1970-01-01
      • 1970-01-01
      • 2010-09-06
      • 2016-06-24
      • 1970-01-01
      相关资源
      最近更新 更多