ruby-debug不会安装/构建本机扩展

时间:2010-11-15 00:17:29

标签: ruby-debug

我已经搜索了高低解决方案。我安装了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

5 个答案:

答案 0 :(得分: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 /)

    < / LI>
  • 明确安装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 =&gt; 1.0.7),因为它坚持安装ruby-debug-base19 v 0.11.24)。

在你的Gemfile中,确保你已经固定了ruby-debug-base19的版本:

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

答案 1 :(得分: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

答案 2 :(得分:2)

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

  

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

答案 3 :(得分:1)

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

答案 4 :(得分:1)

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

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

gem "ruby-debug19"