# Step through the program

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

Stepping is the process of controlling step-by-step execution of the program.

RubyMine provides you with a set of stepping actions. The choice of a particular stepping action depends on your strategy, such as whether you need to go directly to the next line or [inspect](examining-suspended-program.html) the intermediate method calls as well.

The stepping buttons are located on the Debug tool window [toolbar](debug-tool-window.html#Toolbar).

![Stepping buttons in the Debug tool window](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_examining_stepping_buttons.png)

Procedure: Configure the Debug tool window toolbar

Follow these steps to add an action to the Debug tool window toolbar:

1. Right-click the toolbar, select Add to Debugger Toolbar from the context menu.

2. Select the required action from the list.

![Customize Debugger Toolbar - add actions](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_stepping_customize_toolbar_add_actions.png)

## Step over

Steps over the current line of code and takes you to the next line even if the highlighted line has method calls in it. The implementation of the methods is skipped, and you move straight to the next line of the caller method.

Procedure:

* Click the Step Over button ![Step Over button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.run.stepOver.svg) or press `F8` (Windows), `F8` (macOS), `F8` (IntelliJ IDEA Classic (macOS)), `⌘ Quote` (macOS System Shortcuts), `F8` (XWin), `F8` (GNOME), `F8` (KDE), `F8` (Emacs), `F8` (Sublime Text), `F8` (Sublime Text (macOS)), `F10` (Visual Studio), `F10` (Visual Studio (macOS)), `F8` (TextMate), `F8` (NetBeans), `F6` (Eclipse), `F6` (Eclipse (macOS)).

If there are breakpoints inside the skipped methods, the debugger will stop at them.  To skip any breakpoints on the way, use [Force step over](#force-step-over).

## Step into

Enters the method to show what happens inside it.  Use this option when you are not sure the method is returning a correct result.

Procedure:

* Click the Step Into button ![Step Into button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.run.stepInto.svg) or press `F7` (Windows), `F7` (macOS), `F7` (IntelliJ IDEA Classic (macOS)), `⌘ ;` (macOS System Shortcuts), `F7` (XWin), `F7` (GNOME), `F7` (KDE), `F7` (Emacs), `F7` (Sublime Text), `F7` (Sublime Text (macOS)), `F11` (Visual Studio), `⌘ F11` (Visual Studio (macOS)), `F7` (TextMate), `F7` (NetBeans), `F5` (Eclipse), `F5` (Eclipse (macOS)).

If there are several method calls on the line, RubyMine asks you which method to enter. This feature is called [Smart step into](#smart-step-into).

## Smart step into

Smart step into is helpful when there are several method calls on a line, and you want to be specific about which method to enter. This feature allows you to select the method call you are interested in.

> **Note:**
> Note that Smart step into is supported only for [Ruby MRI](supported-ruby-versions.html). For other interpreters (for example, JRuby), Smart step into acts as [Step into](#step-into).

Procedure:

1. Select Smart Step Into from the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) menu or press `Shift+F7` (Windows), `⇧ F7` (macOS), `⇧ F7` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ;` (macOS System Shortcuts), `Shift+F7` (XWin), `Shift+F7` (GNOME), `Shift+F7` (KDE), `Shift+F7` (Emacs), `Shift+F7` (Sublime Text), `⇧ F7` (Sublime Text (macOS)), `Shift+F7` (Visual Studio), `⇧ F7` (Visual Studio (macOS)), `Shift+F7` (TextMate), `Shift+F7` (NetBeans), `Ctrl+F5` (Eclipse), `⌥ F5` (Eclipse (macOS)).

2. Click the method. Alternatively, select the method using the arrow keys or the tab key, and then confirm the selection by pressing either `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) or `F7` (Windows), `F7` (macOS), `F7` (IntelliJ IDEA Classic (macOS)), `⌘ ;` (macOS System Shortcuts), `F7` (XWin), `F7` (GNOME), `F7` (KDE), `F7` (Emacs), `F7` (Sublime Text), `F7` (Sublime Text (macOS)), `F11` (Visual Studio), `⌘ F11` (Visual Studio (macOS)), `F7` (TextMate), `F7` (NetBeans), `F5` (Eclipse), `F5` (Eclipse (macOS)).

![Step into](https://resources.jetbrains.com/help/img/idea/2026.3/rm_get_started_debug_step_into_1.animated.gif)

By default, Smart Step Into is used automatically every time you invoke [Step Into](#step-into) on a line with multiple method calls.

To suppress automatic Smart Step Into,    open the run/debug configuration to launch a debugging session with and switch to the Stepping tab,

and clear the Always do smart step into checkbox.

After that, the ![Smart Step Into](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.smartStepInto.svg) icon appears on the toolbar of the Debug tool window. Click this icon or press `Shift+F7` (Windows), `⇧ F7` (macOS), `⇧ F7` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ;` (macOS System Shortcuts), `Shift+F7` (XWin), `Shift+F7` (GNOME), `Shift+F7` (KDE), `Shift+F7` (Emacs), `Shift+F7` (Sublime Text), `⇧ F7` (Sublime Text (macOS)), `Shift+F7` (Visual Studio), `⇧ F7` (Visual Studio (macOS)), `Shift+F7` (TextMate), `Shift+F7` (NetBeans), `Ctrl+F5` (Eclipse), `⌥ F5` (Eclipse (macOS)) to invoke Smart Step Into manually.

> **Note:**
> The ![Smart Step Into](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.smartStepInto.svg) icon is only available when the debugger stops at a line with multiple calls.

## Step out

Steps out of the current method and takes you to the caller method.

Procedure:

* Click the Step Out button ![Step Out button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.run.stepOut.svg) or press `Shift+F8` (Windows), `⇧ F8` (macOS), `⇧ F8` (IntelliJ IDEA Classic (macOS)), `⌘ \` (macOS System Shortcuts), `Shift+F8` (XWin), `Shift+F8` (GNOME), `Shift+F8` (KDE), `Shift+F8` (Emacs), `Shift+F8` (Sublime Text), `⇧ F8` (Sublime Text (macOS)), `Shift+F11` (Visual Studio), `⇧ F11` (Visual Studio (macOS)), `Shift+F8` (TextMate), `Ctrl+F7` (NetBeans), `F7` (Eclipse), `F7` (Eclipse (macOS)).

## Run to cursor

Continues the execution until the position of the caret is reached.

Procedure:

1. Place the caret at the line where you want the program to pause.

2. Select Run to Cursor from the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) menu or press `Alt+F9` (Windows), `⌥ F9` (macOS), `⌥ F9` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ \` (macOS System Shortcuts), `Alt+Shift+9` (XWin), `Alt+Shift+9` (GNOME), `Alt+Shift+9` (KDE), `Alt+F9` (Emacs), `Alt+F9` (Sublime Text), `⌥ F9` (Sublime Text (macOS)), `Ctrl+F10` (Visual Studio), `⌘ F10` (Visual Studio (macOS)), `Alt+F9` (TextMate), `F4` (NetBeans), `Ctrl+R` (Eclipse), `⌘ R` (Eclipse (macOS)).

Also, in the Classic UI, you can Run to Cursor by clicking the line number in the gutter.

![Run to Cursor with a single click](https://resources.jetbrains.com/help/img/idea/2026.3/rm_inlay_run_to_cursor.png)

You can configure whether you want Run to Cursor to work on clicking a line number in `Settings | Build, Execution, Deployment | Debugger`.

To skip any breakpoints on the way, use [Force run to cursor](#force-run-to-cursor).

## Force step into

Steps in the method even if this method is [skipped](null) by the regular Step Into.

Procedure:

* Press `Alt+Shift+F7` (Windows), `⌥ ⇧ F7` (macOS), `⌥ ⇧ F7` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ ;` (macOS System Shortcuts), `Alt+Shift+F7` (XWin), `Alt+Shift+F7` (GNOME), `Alt+Shift+F7` (KDE), `Alt+Shift+F7` (Emacs), `Alt+Shift+F7` (Sublime Text), `⌥ ⇧ F7` (Sublime Text (macOS)), `Alt+F11` (Visual Studio), `⌥ F11` (Visual Studio (macOS)), `Alt+Shift+F7` (TextMate), `Alt+Shift+F7` (NetBeans), `Alt+Shift+F7` (Eclipse), `⌘ ⌃ F5` (Eclipse (macOS)).

* Click ![the More icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) on the toolbar and select Force Step Into from the list.

![Invoke hidden action - Force Step Into](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_stepping_invoke_hidden_action.png)

* Click ![the Force Step Into icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.run.forceStepInto.svg) on the toolbar.

* Go to `Run | Debugging Actions | Force Step Into`.

```RUBY
def process_numbers(arr)
  puts "Original array: #{arr.inspect}"

  # Force Step Into will implement Array#sort
  sorted = arr.sort

  # Force Step Into will implement String#upcase
  joined = sorted.join(", ").upcase

  puts "Processed result: #{joined}"
  joined
end

numbers = [5, 2, 9, 1]
process_numbers(numbers)

```

## Force run to cursor

[Continues the execution](#run-to-cursor) until the position of the caret is reached. All breakpoints on the way are ignored.

Procedure:

1. Place the caret at the line where you want the program to pause.

2. Select Force Run to Cursor from the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) menu or press `Ctrl+Alt+F9` (Windows), `⌘ ⌥ F9` (macOS), `⌘ ⌥ F9` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ ⇧ \` (macOS System Shortcuts), `Ctrl+Alt+9` (XWin), `Ctrl+Alt+9` (GNOME), `Ctrl+Alt+9` (KDE), `Ctrl+Alt+F9` (Emacs), `Ctrl+Alt+F9` (Sublime Text), `⌘ ⌥ F9` (Sublime Text (macOS)), `Ctrl+Alt+F9` (Visual Studio), `⌘ ⌥ F9` (Visual Studio (macOS)), `Meta+Alt+F9` (TextMate), `Ctrl+Alt+F9` (NetBeans), `Ctrl+Alt+F9` (Eclipse), `⌘ ⌥ F9` (Eclipse (macOS)).

## Force step over

[Steps over](#step-over) the current line of code and takes you to the next line even if the current line has method calls in it. If there are breakpoints in the called methods, they are ignored.

Procedure:

* Select Force Step Over from the ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) menu or press `Alt+Shift+F8` (Windows), `⌥ ⇧ F8` (macOS), `⌥ ⇧ F8` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ Quote` (macOS System Shortcuts), `Alt+Shift+F8` (XWin), `Alt+Shift+F8` (GNOME), `Alt+Shift+F8` (KDE), `Alt+Shift+F8` (Emacs), `Alt+Shift+F8` (Sublime Text), `⌥ ⇧ F8` (Sublime Text (macOS)), `Alt+Shift+F8` (Visual Studio), `⌥ ⇧ F8` (Visual Studio (macOS)), `Alt+Shift+F8` (TextMate), `Alt+Shift+F8` (NetBeans), `Alt+Shift+F8` (Eclipse), `⌘ ⌃ F6` (Eclipse (macOS)).

