Installing Ruby Gems with Native Extensions on Windows

If you’re stuck trying to run Ruby on Windows, one barrier you might have encountered is in trying to install a gem like ruby-debug or rdiscount. You’ll have seen an error like this:

%gem install ruby-debug
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug:
        ERROR: Failed to build gem native extension.
 
C:/Ruby187/bin/ruby.exe extconf.rb
creating Makefile
 
make
'make' is not recognized as an internal or external command, operable program or batch file.
 
 
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/linecache-0.43 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/linecache-0.43/ext/gem_make.out

That’s no fun.

The good news is, the lovely guys at Ruby Installer have put together a fix, called the DevKit. This installs the low-level bits and pieces needed to build those pesky native extensions on your Windows machine. There are a couple of manual steps which I didn’t find especially clear, so I’m documenting them here.

  • Download the DevKit self-extracting archive here
  • Run the archive, and when prompted, choose to extract it to C:\DevKit
  • When the archive has finished unpacking, open a command prompt in C:\DevKit and run ruby dk.rb init ruby dk.rb install
  • That’s it. You can test it using: gem install ruby-debug

Hooray!

Ruby Programming

Comments (5)

Permalink

Bring Git Joy to Windows

Since moving off Windows as my development platform, git has probably been the greatest treat. A great, lightweight, self-contained and very well thought-out piece of software, it’s one of those rare tools that once you’ve used it for a while, you can’t image how you worked without it.

A lot of great ruby tools are using or moving to github, a platform which I’m only just starting to get my head around, but looks really exciting for the development of open-source software.

I suspect windows users probably feel a little excluded from git so in order to spread the love, I thought I’d have a go at installing it on a Windows machine while you just sit back and watch. Wanna play?

Continue Reading »

Agile / Lean Software Development

Comments (4)

Permalink

SSH on Cygwin

I’m following Gina Trapani’s outstanding tutorials on lifehacker to get me some of that unix command-line joy on the rusty old windows box in the corner.

Note to other linux-naive cygwin users out there. If you want to install the ssh command, look for the package called ‘openssh’. No amount of staring at the packages squid and ssmtp is going to make it appear where you might expect it to.

Uncategorized

Comments (0)

Permalink