Let me start off by saying that I love using vim and textmate for hacking sessions, however, when it comes to getting into the nitty gritty details of a running program to figure out what’s going on, it’s nice to have a debugger.
The ruby-debug gem does not work in jruby directly, as it depends on native APIs.
There is a Java-based JRuby implementation of the fast ruby debugger rdebug.
One of my favorite editors is IntelliJ IDEA, and now that it has a Ruby plugin, it’s even better. IDEA allows you to easily navigate classes, and it does a pretty good job with a dynamic language like jruby. One of the best parts about IDEA is being able to visually debug a jruby gem or jruby on rails application directly in the IDE, so that you can step in, over or though method calls, examine variables, evaluate expressions, etc.
In order to get your jruby installation set up correctly, however, there are a few simple steps you need to take first.
1. Manually download the ruby-debug-base-0.10.3-java.gem from debug-commons.
sudo jruby -S gem install ruby-debug-base-0.10.3-java.gem
2. Leave the directory and then do the following:
sudo jruby -S gem install –-ignore-dependencies ruby-debug –version 0.10.3 sudo jruby -S gem install –-ignore-dependencies ruby-debug-ide
3. Now install columnize
sudo jruby -S gem install columnize
You should be good to go. Having an excellent tool to debug your apps could boost your productivity as well.