Ruby on Rails – Practical Ways to Debug Rails

debuggingrubyruby-on-rails

I get the impression that in practice, debuggers are rarely used for Rails applications. (Likewise for other Ruby apps, as well as Python.)

We can compare this to the usual practice for Java or VisualStudio programmers–they use an interactive debugger in a graphical IDE.

How do people debug Rails applications in practice? I am aware of the variety of debuggers, so no need to mention those, but do serious Rails programmers work without them? If so, why do you choose to do it this way?

It seems to me that console printing has its limits when debugging complex logic.

Best Answer

Console printing can work in many situations. This especially, if your code comes in small units instead of large blocks.

Another reason why debuggers are less of an issue in the Rails world is TDD. If you cut down your methods in small and testable items, you can write a complete set of tests for them and make sure they work for a given input. For me this eliminated the need for a debugger. Though this may of course depend on the kind of project. Very large or complex projects may demand to use different tools.

Related Topic