3

I'm trying to install ruby-debug. I'm using Mac OS 10.7.4, XCode version 2308, and Ruby version 1.9.3-p194.

Following the instructions here: http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug, I tried running

sudo gem install ruby-debug

I got the following error:

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

        /Users/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/lib
extconf.rb:16:in `block in <main>': break from proc-closure (LocalJumpError)
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:32:in `<main>'


Gem files will remain installed in /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26 for inspection.
Results logged to /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.26/ext/ruby_debug/gem_make.out

So I tried the following command:

sudo gem install debugger

Which resulted in:

Fetching: columnize-0.3.6.gem (100%)
Fetching: debugger-ruby_core_source-1.1.3.gem (100%)
Fetching: debugger-linecache-1.1.1.gem (100%)
Building native extensions. This could take a while...
Fetching: debugger-1.1.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed columnize-0.3.6
Successfully installed debugger-ruby_core_source-1.1.3
Successfully installed debugger-linecache-1.1.1
Successfully installed debugger-1.1.4
4 gems installed
Installing ri documentation for columnize-0.3.6...
Installing ri documentation for debugger-ruby_core_source-1.1.3...
Installing ri documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing ri documentation for debugger-1.1.4...
Installing RDoc documentation for columnize-0.3.6...
Installing RDoc documentation for debugger-ruby_core_source-1.1.3...
Installing RDoc documentation for debugger-linecache-1.1.1...
Couldn't find file to include 'VERSION' from lib/linecache19.rb
Installing RDoc documentation for debugger-1.1.4...

So I researched the issue and finally came across this post:

how do I install ruby-debug in ruby 1.9.3 / Rails 3.2.1

Everything worked until I tried the command:

gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p194

Which just reproduced the first error, above. So I looked into

rb_method_entry_t.called_id

And found this post: https://github.com/ruby/ruby/pull/56/#issuecomment-3463264

I tried his suggested steps, except for rehash (which I'm not sure how to do with rvm, and didn't want to switch to rbenv just to try it). I downloaded all the gems he recommended to a folder, and ran the following command:

gem install *.gem -- --with-ruby-include=$(echo ~/.rvm/rubies/1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194/) --no-rdoc --no-ri

It installed linecache19-0.5.13 fine, but it choked on ruby-debug-base19-0.11.26.gem, producing the first error again.

I also tried uninstalling the debugger gems added when I ran sudo gem install debugger, but that hasn't changed anything.

I'm at a loss for what to do next.

Community
  • 1
  • 1
andrewhl
  • 992
  • 1
  • 11
  • 31

3 Answers3

0

ruby-debug is broken for ruby 1.9, give "pry" a try, instead. Maybe it is possible to get ruby-debug working but I wouldn't count on it.

Debugging in ruby 1.9

Community
  • 1
  • 1
Björn Nilsson
  • 3,703
  • 1
  • 24
  • 29
0

I know this question is rather old but I got the same error today and this the first result when I google the error.

For me debugger was installing as a dependency and running

gem install debugger

before bundle fixed it.

Charles
  • 379
  • 2
  • 14
0

Just ran into this with Ruby 2.0.0 installed via RVM.

RVM will just install with the binaries if they are available, which is faster, but debugger needs the source too

rvm reinstall 2.0.0 --disable-binary
chris finne
  • 2,321
  • 22
  • 17