JRuby Debugging with IntelliJ IDEA 8

Published: 14 Nov 2008

For the last couple of years I've dabbled with Ruby and JRuby coming from a Java background. Until recently, the only IDE that has had a decent JRuby debugger was NetBeans. Now, with the release of IDEA 8, debugging JRuby is now available in my favorite IDE.

Here are the steps required to debug your JRuby application with IDEA 8:

  1. First, I will assume JRuby version 1.1.4 or above since that's what I happen to be using.
  2. Download ruby-debug-base-0.10.2-java.gem from RubyForge: Debug Commons to a local directory (/tmp).
  3. From /tmp: jruby -S gem install ruby-debug-base-0.10.2-java.gem
  4. Leave the /tmp directory and do the following: jruby -S gem install --ignore-dependencies -v 0.10.2 ruby-debug jruby -S gem install --ignore-dependencies ruby-debug-ide # needed only for IDEs
  5. Now you can debug your JRuby standalone or JRuby on Rails app

The JRuby JDK setup:

A close up of the debugger: