ruby-debug won't install / build native extensions
Asked Answered
G

5

15

I have searched high and low for a solution. I have both linecache19 and ruby_core_source installed.

Neither of these commands will work:

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

Here is the error I keep getting:

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
Glycerin answered 15/11, 2010 at 0:17 Comment(3)
Does ` /Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/ext/ruby_debug/gem_make.out` contain any additional information that wasn't already output to stdout?Seftton
Nope, the same exact error messages as above. Nothing additional.Glycerin
I have the exact same problem. Would be glad for any help!Concuss
W
6

I have had the same issue (on 1.9.1 and 1.9.2). Even trying to install 0.11.23 triggered the error. I found that it was necessary to:

  • Uninstall the gem (all versions for me):

    gem uninstall ruby-debug-base19

  • Delete the 0.11.24 directory (in my case: ~/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-base19-0.11.24/)

  • install 0.11.23 explicitly:

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

This is where I got most of the solution: http://rails.brentsowers.com/2010_08_01_archive.html

Additionally, if you use Bundler:

I had problems until I upgraded to latest Bundler (1.0.2 => 1.0.7) as it insisted on installing ruby-debug-base19 v 0.11.24).

In your Gemfile, make sure you've pinned the version of ruby-debug-base19:

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

Wimple answered 29/11, 2010 at 11:0 Comment(0)
F
4

This one works best for me, because it don't seems too hackish:

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

don't forget to set $rvm_path. In my case, the last folder was ruby-1.9.3-head - pick the right one for you.

got this answer from here: ruby-debug install error: failed to build gem native extension

Foible answered 16/2, 2013 at 17:56 Comment(1)
+1 this one worked... just make sure to use the correct ruby directory.. in my case was $rvm_path/src/ruby-1.9.3-p448/Graiae
T
2

on Debian/Ubuntu/Mint this issue could be solved by installing some of these packages (I'm not sure which is causing the problem)

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

Triangular answered 8/1, 2013 at 14:43 Comment(1)
This limited set also worked for me: apt-get install libcurl4-openssl-dev libgcrypt11-dev libgnutls-dev libidn11-dev libldap2-dev librtmp-dev libtasn1-3-dev m4Hajj
D
1

Do you have gcc installed and path to gcc.exe referenced in your PATH environment variable? This solved similar problem for me, probably this could your solution too!

Doorsill answered 24/12, 2010 at 19:18 Comment(0)
L
1

For the version of ruby I was working with I had to add both of these lines to my Gemfile

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

gem "ruby-debug19"
Lice answered 8/3, 2011 at 20:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.