可能重复:
Rails 3.1 和 Ruby 1.9.3p125:ruby-debug19 仍然崩溃并出现“未找到符号:_ruby_threadptr_data_type”
我已经完成了打印到控制台的工作——我想进入 20 世纪并开始使用调试器!但是如何安装 ruby-debug?ruby-debug.c
当我尝试安装 ruby-debug19 gem 时,本机编译失败。我查看了其他 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
gem install ruby-debug 从命令行不起作用
如果我尝试从命令行构建 gem,使用指向include
当前 ruby 目录的 --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 坏了吗?