15

我一直在寻找解决方案。我都有linecache19ruby_core_source安装了。

这些命令都不起作用:

gem install ruby-debug19
gem install ruby-debug19 -- --with-ruby-include=/Users/benjohnson/.rvm/src/ruby-1.9.1-p378

这是我不断收到的错误:

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

/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/bin/ruby extconf.rb
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
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
gcc -I. -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/i386-darwin10.4.0 -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby/backward -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1 -I. -DHAVE_VM_CORE_H -DHAVE_ISEQ_H -DHAVE_INSNS_INC -DHAVE_INSNS_INFO_INC -DHAVE_EVAL_INTERN_H -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby-1.9.1-p378 -fno-common  -O2 -g -Wall -Wno-parentheses  -fno-common -pipe -fno-common  -o breakpoint.o -c breakpoint.c
gcc -I. -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/i386-darwin10.4.0 -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby/backward -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1 -I. -DHAVE_VM_CORE_H -DHAVE_ISEQ_H -DHAVE_INSNS_INC -DHAVE_INSNS_INFO_INC -DHAVE_EVAL_INTERN_H -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby-1.9.1-p378 -fno-common  -O2 -g -Wall -Wno-parentheses  -fno-common -pipe -fno-common  -o ruby_debug.o -c ruby_debug.c
ruby_debug.c: In function ‘ruby_method_ptr’:
ruby_debug.c:141: error: ‘rb_method_entry_t’ undeclared (first use in this function)
ruby_debug.c:141: error: (Each undeclared identifier is reported only once
ruby_debug.c:141: error: for each function it appears in.)
ruby_debug.c:141: error: ‘method’ undeclared (first use in this function)
ruby_debug.c:142: warning: implicit declaration of function ‘rb_method_entry’
ruby_debug.c: In function ‘debug_event_hook’:
ruby_debug.c:719: error: ‘rb_method_entry_t’ undeclared (first use in this function)
ruby_debug.c:719: error: ‘me’ undeclared (first use in this function)
make: *** [ruby_debug.o] Error 1


Gem files will remain installed in /Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24 for inspection.
Results logged to /Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/ext/ruby_debug/gem_make.out
4

5 回答 5

6

我遇到了同样的问题(在 1.9.1 和 1.9.2 上)。即使尝试安装 0.11.23 也会触发错误。我发现有必要:

  • 卸载 gem(我的所有版本):

    gem uninstall ruby-debug-base19

  • 删除 0.11.24 目录(在我的例子中:~/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-base19-0.11.24/)

  • 显式安装 0.11.23:

    gem install ruby-debug-base19 --version=0.11.23

这是我得到大部分解决方案的地方:http ://rails.brentsowers.com/2010_08_01_archive.html

此外,如果您使用 Bundler:

在升级到最新的 Bundler (1.0.2 => 1.0.7) 之前我遇到了问题,因为它坚持安装 ruby​​-debug-base19 v 0.11.24)。

在您的 Gemfile 中,确保您已固定 ruby​​-debug-base19 的版本:

gem "ruby-debug-base19", "0.11.23", :require => nil

于 2010-11-29T11:00:59.093 回答
4

这个最适合我,因为它看起来不太老套:

gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/

不要忘记设置 $rvm_path。就我而言,最后一个文件夹是 ruby​​-1.9.3-head - 为您选择合适的文件夹。

从这里得到这个答案:ruby-debug install error: failed to build gem native extension

于 2013-02-16T17:56:34.047 回答
2

在 Debian/Ubuntu/Mint 上,这个问题可以通过安装其中一些软件包来解决(我不确定是哪个导致了问题)

apt-get install libcurl4-openssl-dev libgcrypt11-dev libgnutls-dev libidn11-dev libldap2-dev librtmp-dev libtasn1-3-dev m4

于 2013-01-08T14:43:08.250 回答
1

您是否安装了 gcc 并在 PATH 环境变量中引用了 gcc.exe 的路径?这为我解决了类似的问题,也许这也可以解决您的问题!

于 2010-12-24T19:18:02.667 回答
1

对于我正在使用的 ruby​​ 版本,我必须将这两行都添加到我的 Gemfile

gem 'ruby-debug-base19', '0.11.23'

gem "ruby-debug19"
于 2011-03-08T20:50:50.290 回答