Software Development | Ruby on Rails
Installing ruby_debug on Windows

Windows lacks some of the prerequisites that ruby-debug assumes. So when installing altered_beast I got this error message when installing ruby_debug:

>gem install ruby-debug
ERROR: Error installing ruby-debug: 
ERROR: Failed to build gem native extension.

C:/InstantRails-2.0/ruby/bin/ruby.exe extconf.rb
creating Makefile

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

I got a similar error when Installing RadRails. In this case it fails on the ruby-debug-ide because it need ruby-debug-base. But installing ruby-debug-base fails for the same reason as above, i.e. it need nmake.

>gem install -l ruby-debug-ide-0.4.5.gem
ERROR: Error installing ruby-debug-ide-0.4.5.gem:
ruby-debug-ide requires ruby-debug-base (~> 0.10.3.0, runtime)
>gem install ruby-debug-base 0.10.3.0
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-base:
ERROR: Failed to build gem native extension.

C:/InstantRails-2.0/ruby/bin/ruby.exe extconf.rb
creating Makefile

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

nmake

ruby-debug 0.9.3 comes with a precompiled binary and will install fine (post by Java at Ruby on Rails: Ruby-debug in Windows Vista). Unfortunately the more recent versions (0.10.0 and later) don't include a precompiled binary so Windows tries to automatically generate a binary using nmake. nmake is a Microsoft make utility that comes with Visual Studio. It is the equivalent of make on Linux, OS X, etc.  Unlike the Linux version nmake is not a standard part of the operating system and is not in the run path.

So what to do?

Run nmake manually

Some people manually run nmake on Windows to get build the binary. If you've got Visual Studio installed you could try this by following Amitava's Technical Diary: Gem Install Ruby-Debug fails in Windows. Seemed too hard to me.

Install ruby_debug 0.9.3 (for altered_beast)

If you can get away with using 0.9.3 (which is okay with altered_beast for example) you can install the Windows friendly version with:

gem install ruby-debug -v 0.9.3

Installing ruby_debug_base 0.10.3 (for RadRails)

That won't work for RadRails.  I've just installed Aptana RadRails, build: 2.0.2.1257900714 and it demands ruby_debug_base 0.10.3 and no other.

Define Null: Netbeans 6 Ruby Fast Debugger has some good suggestions regarding this problem although I had to tweak it a bit.

1. Close RadRails.

2.Download ruby-debug-base gem from Ruby Forge: ruby-debug-base-0.10.3-mswin32.gem e.g. to C:\temporary. In my case the ".gem" extension was changed to ".tar" in the download. I don't know why. Apparently some operating systems do this. If that happens to you then rename it back to ".gem".

3. Then from a command line:

cd /d C:\temporary
gem install ruby-debug-base -l
gem install ruby-debug

4. Then restart RadRails and it will automatically install the ruby-debug-ide 0.4.5. RadRails issues this command (you don't have to do anything):

gem install ruby-debug-ide -v 0.4.5

Note: I tried installing ruby-debug-ide from the command line using the same command and it didn't work. I don't know why this failed but it works when RadRails issues the same command.