One way of debugging your ruby scripts is to print out the value of variables in different sections of your code.
Rubymine has a feature called live templates that allows you to type a short command and have RubyMine extract it in to full blown code. Some built in shortcuts exist, such as def (creates a method), desc (create a RSpec test), it (RSpec test), etc.
To create your own, go to RubyMine -> Preferences -> Live Templates. Click one of the existing templates and hit Copy.
I named mine pl (Put Line Number) and put the following content in:
Now when I’m typing code, I can hit the following:
And it will print out the following:
I’ve found this helpful for tracking down where a specific print statement is located.