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.
Copy the jar into the SonarQube plugin directory (e.g. /opt/sonarqube/extensions/plugins) In order to run the analysis for Ruby you will need to utilize the sonar-scanner application. Make sure you have a sonar-project.properties file in the root of your project directory
After entering the debugging session, you can type in Ruby code as you're in a Rails console or IRB. You can also use p or pp command to evaluate Ruby expressions (e.g. when a variable name conflicts with a debugger command). Besides direct evaluation, debugger also helps you collect rich amount of information through different commands.
When you actually need to journey into your running source code, the debugger is your best companion. The debugger can also help you if you want to learn about the Rails source code but don't know where to start.
Ruby Solargraph is one of the most helpful plugins on this list, and provides IntelliSense, code completion, and inline documentation for Ruby. Inline documentation helps you view all the allowed methods of the class/object, and also helps you easily understand the definition of each method and its arguments.
Have a look at http://docs.sonarqube.org/display/DEV/Extend+Web+Application. See section Applications -> Development mode.
Regards
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With