How do I debug with the IntelliJ IDEA Ruby Plugin in Mac OS X?

I am having problems debugging with the  IntelliJ IDEA Ruby Plugin.  Whenever I press the the Debug button I get the following error:

Error running pretty_word_count:

Cannot start debugger.  Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist.

My enviroment is:
  • Mac OS X Snow Leopard 10.6.7
  • Java version: 1.6.0_24
  • IntelliJ IDEA 10
  • Ruby plugin installed
  • JRuby 1.6.1
  • ruby-debug-base, ruby-debug, and ruby-debug-ide gems installed using the gem command from JRuby

Any  help will be appreciated.
Comment actions Permalink

I'm don't think that your Ruby interpretter is the one you think it is.  If JRuby is managing your gems, are you sure that your project is running with the JRuby interpreter rather than the one that is already on OS X?  Under "Project Settings", what is the value of Ruby SDK and GEMs?  If it says something like "ruby 1.8.7blahblahblah /usr/bin/ruby", I'm thinking that you're running with the OS X default rather than the JRuby that you wanted.

I don't know exactlly how, or if, you can correct this, but I think it is the /usr/bin/gem that matches the /usr/bin/ruby that is missing ruby-debug-ide.

Comment actions Permalink

Thanks Robert.  This was not the problem.  The problem was the Language level entry.  It was "version 1.9" and as soon as I changed it to "version 1.8" the error disappeared.

However, I need to use version 1.9.  So far, I have been unable to debug with version 1.9.  I have to investigate further.  I believe the problem has something to do with JRuby itself.


Comment actions Permalink

I can also reproduce this behavior using JRuby with Intellij IDEA 10.0.3 and the Ruby plugin 3.1.17343 on both OS X and Windows 7 (using JRuby 1.6.1-p330 in both cases).

Setting the language level for the JRuby SDK to "version 1.9" triggers the error, setting it to "version 1.8" and debugging the same project works.

Comment actions Permalink

I dug into it a bit further and it looks like it may actually failing to find ruby-debug-base19x (in RubyAbstractCommandLineState::createDefaultDebugCommandLine).

Unfortunately there doesn't seem to be a version of that gem that builds with JRuby at this point in time.

I cloned the ruby-debug-base (java 0.10.4) gem and called it "ruby-debug-base19x" and can now at least launch the debugger in --1.9 mode, but it bombs out with the error "[ 137858]   WARN - debugger.impl.RubyDebugProcess - Couldn't resume during timeout", so I guess there may be some functional difference in the 19x debug gem that will be required to get things to work.


Please sign in to leave a comment.