【发布时间】:2012-02-03 00:46:53
【问题描述】:
我已经完成了打印到控制台的工作——我想进入 20 世纪并开始使用调试器!!但是如何安装 ruby-debug?当我尝试安装 ruby-debug19 gem 时,ruby-debug.c 的本机编译失败。我查看了其他 SO 帖子,但尚未找到答案...
- 我正在使用 Ruby 1.9.3-p0
- 我使用的是 Rails 3.2(当然是 Gemfile)
- 我没有使用 RVM - 相反,我有一个包含所有可执行文件、gem、源等的完全沙盒目录。我在下面将其称为 $SANDBOX...
捆绑安装不起作用
如果我将 ruby-debug19 添加到我的 Gemfile 并执行 bundle install,它会在使用 conflicting types for 'rb_iseq_compile_with_option' 构建期间失败:
# file: Gemfile
...
group :development do
gem 'ruby-debug19'
end
...
% bundle install
...
Installing ruby-debug-base19 (0.11.25) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/r/Developer/Topaz/usr/bin/ruby extconf.rb
...
ruby_debug.c:29: error: conflicting types for 'rb_iseq_compile_with_option'
$SANDBOX/usr/include/ruby-1.9.1/ruby-1.9.3-p0/vm_core.h:505: error: previous declaration of 'rb_iseq_compile_with_option' was here
...
make: *** [ruby_debug.o] Error 1
从命令行安装 ruby-debug 不起作用
如果我尝试从命令行构建 gem,使用指向当前 ruby 的 include 目录的 --with-ruby-include 参数,我会得到同样的错误:
% gem install ruby-debug19 -- --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p0
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug19:
ERROR: Failed to build gem native extension.
$SANDBOX/usr/bin/ruby extconf.rb --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p0/include
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
creating Makefile
make
compiling breakpoint.c
compiling ruby_debug.c
ruby_debug.c:29: error: conflicting types for 'rb_iseq_compile_with_option'
$SANDBOX/usr/include/ruby-1.9.1/ruby-1.9.3-p0/vm_core.h:505: error: previous declaration of 'rb_iseq_compile_with_option' was here
我错过了什么?
--with-ruby-include 是否期待不同的东西?当前的 ruby-debug19 坏了吗?
【问题讨论】:
-
谷歌搜索表明很多人在 1.9.3 上遇到了调试器问题。似乎有一些技巧可以让它工作:gist.github.com/1331533blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
-
@Marc:在这两个链接之间,我得到了它的工作。请参阅下面的答案。
-
嗨@casperOne——只是好奇:这个问题是之前发布到stackoverflow.com/questions/9442200/…的——根据常见问题解答,不应该是那个被关闭的问题重复?
-
@fearless 不,发布时间并不能明确指出哪个问题是在欺骗另一个问题。
标签: ruby-on-rails ruby gem ruby-debug