JRuby Debugging with IntelliJ IDEA 8
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:
- First, I will assume JRuby version 1.1.4 or above since that's what I happen to be using.
ruby-debug-base-0.10.2-java.gemfrom RubyForge: Debug Commons to a local directory (/tmp).
- From /tmp:
jruby -S gem install ruby-debug-base-0.10.2-java.gem
- 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
- Now you can debug your JRuby standalone or JRuby on Rails app
A close up of the debugger: