NetBeans 6.9.1 + Ruby 1.9.2 + Rails 3.0.0 + Debugging

By , 2010-09-17 20:30:17

This fix is for anyone that has NetBeans 6.9.1, Ruby 1.9.2, Rails 3.0.0, already installed, and decides to add support for debugging on Windows XP.

That was my configuration, but it didn’t work properly. A debug session always ended with an error about a non existing script/rails file. After some research, today I discovered this fix that eventually allows me to cleanly debug a Ruby on Rails 3.0.0 project.

ONCE
  1. Download DevKit 4.5.0 from http://rubyinstaller.org/downloads/
  2. Install DevKit as described at http://github.com/oneclick/rubyinstaller/wiki/Development-Kit
  3. Enter the command gem install ruby-debug19 --platform=ruby
  4. Enter the command gem install ruby-debug-ide19 --platform=ruby
  5. Edit the file (Ruby folder)/lib/ruby/gems/1.9.1/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb as follows # noteslog.com, 2010-09-17 -> !!! #142 $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.9) listens on #{host}:#{port}\n" $stderr.printf "Fast Debugger (ruby-debug-ide19 0.4.12) listens on #{host}:#{port}\n" #!!! This one isn’t required, but I find wrong labels very distracting
  6. Edit the file (Ruby folder)/lib/ruby/gems/1.9.1/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide.rb as follows # noteslog.com, 2010-09-17 -> !!! #78 Debugger::PROG_SCRIPT = ARGV.shift script = ARGV.shift Debugger::PROG_SCRIPT = (script =~ /script([\\\/])rails/ ? Dir.pwd + $1 : '') + script #!!! See also: http://netbeans.org/projects/ruby/lists/users/archive/2010-09/message/25
PER PROJECT
  1. Edit the file (Project folder)/Gemfile as follows # To use debugger # gem 'ruby-debug' gem 'ruby-debug19'
  2. delete the file (Project folder)/Gemfile.lock
  3. Enter the command bundle update

That’s all. I hope it’ll work for you too :-)

Leave a Reply

14 Responses to “NetBeans 6.9.1 + Ruby 1.9.2 + Rails 3.0.0 + Debugging”

  1. prem says:

    many thanks,
    i took two weeks to solve this ruby-debug problem,
    guys pls use the same version

  2. Rahul says:

    Thanx!!! Works like a gem :)

  3. Steven says:

    Worked with NB 7, thanks!

  4. Agustin says:

    A bunch of months later, you made my day… I was looking to downgrade to RoR 2 because all the troubles with NetBeans 6.9 and RoR 3 and debugging.
    Thanks a lot!

  5. Helder Meneses says:

    Oh my god…

    this is so awesome…

    thank you…

  6. iponk says:

    nice post… it’s usefull

  7. Kev says:

    Anyone know where I can get a later build of Netbeans 6.9.1 than the official release?

    I ask because this technique works on one of my machines that has NB build 201007282301, whereas the official 6.9.1 release is *older*, and won’t work with this technique.

  8. rc says:

    Thanks! Thanks to your post, I can continue using Netbeans for my Rails development! I found the lack of a working debugger to be the #1 reason I was leaning to dump Netbeans. Thanks!

  9. [...] If you want to run in debug mode in NetBeans, then check out this patch: http://noteslog.com/post/netbeans-6-9-1-ruby-1-9-2-rails-3-0-0-debugging/ [...]

  10. Saul says:

    Awesome! Worked a treat!

  11. bee says:

    Thanks! solve my ruby-debug-ide problem!

  12. Keith says:

    Thanks great post.
    This fix to rdebug-ide.rb also work for me on ubuntu 10.04

  13. Meyer says:

    Thanks so much!!!
    Your page was a god send!!

  14. [...] ??? http://noteslog.com/post/netbeans-6-9-1-ruby-1-9-2-rails-3-0-0-debugging/ [...]

Panorama Theme by Themocracy