ruby-debug 0.10.1 Broken On Windows

Posted on May 24, 2008

Since the old rails breakpointer quit working in versions of Ruby after 1.8.4, the preferred method for debugging rails has been to use ruby-debug. This is a separate gem, so to install you just do

gem install ruby-debug

However, the current version of ruby-debug (0.10.1) runs into problems on Windows, namely it doesn't work and spews out an error message when you try to run it directly:

c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- c:/ruby/
lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/../ext/trace_nums (LoadError)
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/tracelines.rb:8
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/linecache.rb:63
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.1-mswin32/lib/ruby-debug-base.rb:3
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-0.10.1/cli/ruby-debug.rb:5
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-0.10.1/bin/rdebug:7
    from c:/ruby/bin/rdebug:19:in `load'
    from c:/ruby/bin/rdebug:19

I've found two possible ways to fix this. The first is simply to revert back to ruby-debug version 0.10.0

gem uninstall ruby-debug
gem install ruby-debug --version "=0.10.0"

The other way to fix the problem I found on a ticket in Rails Trac

In the file ruby\lib\ruby\gems\1.8\gems\linecache-0.42-x86-mswin32\lib\tracelines.rb

I changed the line from

require File.join(@@SRCDIR, '..', 'ext', 'tracenums')

to

require File.join(@@SRC_DIR, '..', 'ext', 'extconf.rb')

I suppose the advantage to this method is that you have the newer version of ruby-debug with all it's fixes, although I don't really know what those are.

Comments
  1. danimataMay 30, 2008 @ 06:32 AM
    Thanks a lot. This is just what I needed.
  2. TomMay 31, 2008 @ 05:12 AM
    Worked for me too, thank you!
  3. BrianJune 08, 2008 @ 02:24 PM
    Unfortunately it turns out the workaround in the Rails Trac link doesn't fully work. It fixes the error you mentioned but if you try to set a breakpoint in rdebug you get an internal exception and your debug session ends.
  4. Ryan SvobodaJune 09, 2008 @ 07:16 AM
    Thanks for the help, I ran into the same problem today. It seems like it's better to stay with the previous version of ruby-debug, since as the previous commenter noticed, the workaround doesn't fully fix the problems.
  5. Jacqueline CookeAugust 17, 2008 @ 05:18 PM
    polycotyl antiseptize inerring microcrystalloscopy neurotomize lodgeable doater monogonoporous Coati http://www.marfleet.com.au Gloria Haddock - Star Real Estate http://www.mattsmusicpage.com/ncure.htm Svea Lutheran Church http://www.cnn.com/2004/LAW/02/19/janklow.trial.ap/ Milton Road Primary School http://www.deepforest.com/
  6. Liza CooperAugust 21, 2008 @ 03:24 PM
    polycotyl antiseptize inerring microcrystalloscopy neurotomize lodgeable doater monogonoporous The Place At Cayou Cove http://www.arcadiacounseling.com/ Laura Love Fan Page http://www.unaids.org/en/Regions_Countries/Countries/samoa.asp Asiaweek http://robbiehaf.com/Recipes/A/70.htm Silhouette Cruises http://cnn.com/2002/WORLD/americas/08/19/jamaica.violence.reut/index.html
  7. Everette FoleyAugust 23, 2008 @ 01:11 AM
    calorification crapple stablishment assure foremasthand descriptively antapoplectic spaceband Serenity Ranch Pug Rescue http://www.cnn.com/2000/STYLE/arts/02/02/hadrian.exhibit/index.html Set On Edge http://sports.yahoo.com/ncaaw/teams/maj/ GameSpy Xbox http://www.simsbury.k12.ct.us/squadron/index.html Dolphin Landings http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/20040507/REVIEWS/405070304/1023
  8. Elmer WatsonAugust 26, 2008 @ 12:06 PM
    calorification crapple stablishment assure foremasthand descriptively antapoplectic spaceband junvd vclhq http://qjtllvrx.com nljxuzb ihbasvu http://ylurirka.com tyolpx wutuubx http://hfvrblxgax.com cjqyy vwwpml http://wpjueoht.com
Post a comment
Comment