Ruby

Ruby 1.9.3 and ruby-debug

How to get ruby-debug working with Ruby 1.9.3 by installing the unreleased but fixed version from Rubyforge.

1 min read
Santiago Pastorino
Santiago Pastorino Published on Nov 1, 2011

As you probably know Ruby (MRI so brixen doesn’t get mad at me :P) 1.9.3 was released. I’ve been using 1.9.3 for a while now and as part of my RubyConf Uruguay talk I wanted to show ruby-debug. So my first attempt was:

$ gem install ruby-debug19
Fetching: linecache19-0.5.12.gem (100%)
Building native extensions.  This could take a while...
Fetching: ruby-debug-base19-0.11.25.gem (100%)
Building native extensions.  This could take a while...
Fetching: ruby-debug19-0.11.6.gem (100%)
Successfully installed linecache19-0.5.12
Successfully installed ruby-debug-base19-0.11.25
Successfully installed ruby-debug19-0.11.6
3 gems installed

Then require ‘ruby-debug’ and booom!!

$ irb
irb(main):001:0> require 'ruby-debug'
LoadError: dlopen(...ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread
  Referenced from: ...ruby_debug.bundle
  Expected in: flat namespace
 in ...ruby_debug.bundle - ...ruby_debug.bundle
	from .../custom_require.rb:36:in `require'
	from .../custom_require.rb:36:in `require'
	from .../ruby-debug-base.rb:1:in `<top (required)>'
	from .../custom_require.rb:36:in `require'
	from .../custom_require.rb:36:in `require'
	from .../ruby-debug.rb:5:in `<top (required)>'
	from .../custom_require.rb:59:in `require'
	from .../custom_require.rb:59:in `rescue in require'
	from .../custom_require.rb:35:in `require'
	from (irb):1
	from .../irb:12:in `<main>'

So after some research on the internet I found out that the author of ruby-debug had a fix for it which he considered unstable and didn’t push it to rubygems.org yet. Since I prefer an unstable ruby-debug than a non working one :P, I gave it a try …

First download linecache19-0.5.13.gem and ruby-debug-base19-0.11.26.gem from Rubyforge, then …

$ gem install linecache19-0.5.13.gem
Building native extensions.  This could take a while...
Successfully installed linecache19-0.5.13
1 gem installed
$ gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rbenv/source/ruby-1.9.3-p0
Building native extensions.  This could take a while...
Successfully installed ruby-debug-base19-0.11.26
1 gem installed
$ irb
irb(main):001:0> require 'ruby-debug'
=> true

and voilá.

So while we wait for an official release, you can enjoy a working ruby-debug.

Article you may like

View All

Let's build together.

Ready to partner with a team that cares as much about your success as you do?

+1