RubyMine
 
Get RubyMine

Tutorial: Debug in IRB/Rails console

Last modified: 11 February 2024

After you have run the IRB or Rails console, RubyMine creates a temporary run/debug configuration. This configuration allows you to rerun the console or launch it in the debug mode. In this tutorial, we'll show you how to load and debug specific parts of code in the IRB console.

A sample Ruby application used in this tutorial has two files - script.rb and song.rb. We'll debug the to_s method called for the newly created Song object.

require './song'
puts Song.new("My Way", "Sinatra").to_s

Perform the following steps to debug this program code in the IRB console.