Extending Ruby debugging integration past RVM

Answered

I contribute to https://github.com/jruby-gradle and I've been interested in integrating into the IDEA Ruby plugin's integration for debugging. I'm not even sure where to start since the Ruby plugin is integrated with RVM and JRuby Gradle provides a pretty different approach to managing dependencies and tasks.

I'd be happy to get some pointers to code and how I might integrate to make debugging on IDEA with JRuby Gradle top-notch :)

4 comments
Comment actions Permalink

Hi,

I'm not sure I've got the whole picture of the problem you see, but let me try to rephrase my understanding so you could correct/clarify the problem for me.
First of all, debugger works with any ruby (jruby) process which is executed in a special way (which is not version manager-specific)
I.e. debugger doesn't care if you run ruby from RVM/RBenv/PIK or plain ruby installation.
I know nothins abour jruby-gradle but if it is just a replacer for bundler then the important questions are:
- where it stores gems it loads
- how user is supposed to run an application so all dependencies were available in runtime

Regards, Oleg.

0
Comment actions Permalink

oleg.sukhodolsky wrote:

I'm not sure I've got the whole picture of the problem you see, but let me try to rephrase my understanding so you could correct/clarify the problem for me.

First of all, debugger works with any ruby (jruby) process which is executed in a special way (which is not version manager-specific)
I.e. debugger doesn't care if you run ruby from RVM/RBenv/PIK or plain ruby installation.


This is very useful to know actually! The way that JRuby Gradle will invoke Ruby is through a bundled version of the jruby-complete jar (more often than not). What this currently means is that executing Ruby looks like this:

* User executes Gradle in JVM
* Gradle ensures gems are downloaded properly
* Gradle forks sub-JVM to execute "java -jar path/to/jruby-complete.jar org.jruby.Main <user-specified commands>"
* Sub-JVM with JRuby executes, exits
* Gradle exits

oleg.sukhodolsky wrote:

I know nothins abour jruby-gradle but if it is just a replacer for bundler then the important questions are:

- where it stores gems it loads
- how user is supposed to run an application so all dependencies were available in runtime


Currently gems are installed via "gem install" into "$projectDir/build/gems", and this is managed by the JRuby Gradle tooling.

The way a user, at least during a development cycle, would be executing Ruby would be via a Gradle task, which would follow the steps listed above. I can invoke JRuby in whichever way is necessary to get the debugger to hook into it!

0
Comment actions Permalink

Hi,

to run ruby debugger you need to install ruby-debug-ide and ruby-debug-base gems and run rdebug-ide command with appropriate args.
And there is no way to connect to jruby process which is executed w/o the wrapper :(

Regards, Oleg.

0
Comment actions Permalink

A fully integrated Jruby / Gradle / IDEA solution would be great , I had to hack generating IML to keep things in sync

0

Please sign in to leave a comment.