Debugging Ruby and Rails code inside Sonar plugin

684 views Asked by At

What is the way to debug Rails and Ruby code (i.e. breakpoints, call stack etc...) which is running inside a separate JVM using IDE (IntelliJ Idea)? What configuration is required for it in Sonarqube and IntelliJ?
I did not find this information on Sonarqube site or elsewhere.

2

There are 2 answers

4
Julien L. - SonarSource Team On

Have a look at http://docs.sonarqube.org/display/DEV/Extend+Web+Application. See section Applications -> Development mode.

Regards

0
williamcodes On

Your best bet is to go with RubyMine: https://www.jetbrains.com/ruby/

It's a version of Intellij for Ruby and Rails. It's got excellent debugging tools. You can find more information about how to set breakpoints and so forth here: https://www.jetbrains.com/ruby/features/ruby_debugger.html

RubyMine is gaining popularity, but most ruby developers just drop a binding.pry at the point in their code they want to debug. Pry is an extremely popular gem that offers great debugging tools. Here's more info on how to use that particular feature: https://github.com/pry/pry#runtime-invocation