If you are using Netbeans as a development environment for creating Ruby on Rails software, you should know how to debug your application. Using these out-of-the-box frameworks are really great when it comes to the speed of the development however, whenever you face strange behavior, debugging is the key.
In Netbeans it is very easy, but you could run into problems if you need to update your gems in case fast debugger is not installed. The window below would show up in case this is the first time you try to debug something in Netbeans.

Click on "Install Fast Debugger" to have the gem installed. If you get a weird message like the one below, please refer to this other article where you will find more details on updating gems.
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 403
You will then see the gem installation window.

Now here is the catch. Netbeans will try to download the sources and compile then using any standard gcc compiler it finds, but if you are using windows normally you do not have this installed as it is common in linux and Mac Os. So you cannot count on Netbeans to download correctly and automatically this gem for you, because it will show you this nice error Window.

Tip:Even after updating the RubyGems component (instructions here) Netbeans will not realize you have a new version of RubyGems. Even after restarting the IDE you could see an error message when trying to run the Gem tool from the IDE (Tools > Ruby Gem) like the one in red on the window below. The solution is to remove the ruby platform (Tools > Ruby Platforms > Remove) and install it again.

This sucks! Why would Sun release a version of NetBeans that needs a component which is not prepared to run under windows? Their page with instructions on Ruby Gems does not mention Windows at all and their page about debugging does not mention it either (at least at the time of this writing - hopefully they will update those). Even worst is that the ruby-debug project was last updated on November 2008, more than a year ago, so do not get your hopes up high on having this fixed so soon.
One possible solution for this problem is to install Visual Studio 6 only with Visual C++ (which is free) in your machine, but I do not like this, so I kept trying to find another solution.
First of all download the ruby-debug-base-0.10.3-x86-mswin32.gem file and, on a command window, change to the folder where you put this downloaded file and run the command below:
C:\repository\software\Ruby>gem install ruby-debug-base -l Successfully installed ruby-debug-base-0.10.3-x86-mswin32 1 gem installed Installing ri documentation for ruby-debug-base-0.10.3-x86-mswin32... Installing RDoc documentation for ruby-debug-base-0.10.3-x86-mswin32...
Now you will be able to install the ruby-debug latest version (0.10.3) because the above command skipped the 'nmake' problem by providing a component already built for windows. Run the following command:
C:\repository\ruby\prp>gem install ruby-debug Successfully installed ruby-debug-0.10.3 1 gem installed Installing ri documentation for ruby-debug-0.10.3... Installing RDoc documentation for ruby-debug-0.10.3...
After doing that, I tried installing the latest version of ruby-debug-ide (0.4.9) and had the same problems. Then I tried v. 0.4.8 and this did not work either, so I decided to go back to Netbeans and try installing from there. This worked, but the only working version was 0.4.4 which is quite old

C:\repository\ruby\prp>gem list -d ruby-debug-ide
*** LOCAL GEMS ***
ruby-debug-ide (0.4.4)
Author: Markus Barchfeld, Martin Krauskopf
Rubyforge: http://rubyforge.org/projects/debug-commons
Homepage: http://rubyforge.org/projects/debug-commons/
Installed at: c:/dev/ruby186-26/lib/ruby/gems/1.8
IDE interface for ruby-debug.
Anyway, I am not happy with this solution so I've posted a bug at Netbeans Bugzilla hoping that they will fix this and opened a discussion at RubyForge's ruby-debug-ide project.
Comments
Gem arrives with .tar extension
One must rename the .gem.tar file to .gem, then execute the gem install command.
Bloody brilliant
You sir should be worshipped like a God.
I love you! Thank you!
I love you! Thank you!
0.4.4
thanks so much for this! its very helpful. I managed to install locally but I cannot seem to find 0.4.4. How do I install it directly from netbeans? It does not show up. All I see is the ruby-debug-ide and the ruby-debug-ide19.
Thanks!
Gee... Thanks dude - just great!
THANKS
WOW, you are awesome.
Error
I am still getting following error after performing steps mentioned in article
cl -nologo -I. -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -c -Tcbreakpoint.c
cl : Command line warning D9035 : option 'Og-' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-G6'
breakpoint.c
breakpoint.c : fatal error C1902: Program database manager mismatch; please check your installation
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2'
Stop.
Cannot reproduce
Sorry, but I never faced this error before.
After which step exactly do you get this error? Does it happen when starting NetBeans or when doing something else?
RubyInstaller DevKit fixes this
If you install Ruby using RubyInstaller (http://rubyinstaller.org/download.html), and next install RubyInstaller Development Kit (http://wiki.github.com/oneclick/rubyinstaller/development-kit) on top of that, then the NetBeans "Install Fast Debugger" feature works without problems.
The RubyInstaller Development Kit provides some standalone elements of MinGW for compiling Ruby native C extensions.
Joe Howse