gpt4 book ai didi

ruby - 无法安装 ruby​​-debug,错误 : rb_method_entry_t. called_id

转载 作者:数据小太阳 更新时间:2023-10-29 08:13:14 25 4
gpt4 key购买 nike

我正在尝试安装 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 只是为了尝试)。我将他推荐的所有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 上卡住,再次产生第一个错误。

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

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

最佳答案

ruby-debug 对于 ruby​​ 1.9 是坏的,试试“pry”,而不是。也许可以让 ruby​​-debug 正常工作,但我不会指望它。

Debugging in ruby 1.9

关于ruby - 无法安装 ruby​​-debug,错误 : rb_method_entry_t. called_id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11231297/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com