# Start the debugger session

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

RubyMine allows you to debug Ruby scripts, Rails applications, and tests. Starting a debugger session is very similar to running your code. The debugger is attached behind the scenes, so you don't have to configure anything specific to start a debugger session. The topics below describe how to run:

* [Ruby scripts](running-ruby-scripts.html)

* [Rails applications](running-applications.html)

* [Rake tasks](rake.html)

* [Tests](performing-tests.html)

RubyMine allows you to debug code without previous configuring or by using the configured set of startup parameters - [run/debug configurations](run-debug-configuration.html). For instance, you can specify the following parameters for the Rails run/debug configuration: a server type (such as Puma or Passenger), IP address and port, environment (development by default), and so on.

## Before debugging

Procedure:

1. [Set breakpoints](using-breakpoints.html#set-line-breakpoint) in the source code.

2. If necessary, create or modify the corresponding [Run/Debug configuration](run-debug-configuration.html).

3. Configure the debugger options on the `Settings | Build, Execution, Deployment | Debugger` page.

## Start debugging

Procedure: Debug a Ruby script

To debug a specified Ruby script (for example, script.rb), do one of the following:

1. Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (TextMate), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to invoke the Run Anything popup and type the `ruby script.rb` command. Then, hold down the `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (TextMate), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) key (the dialog title will be changed to Debug) and press `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)).

> **Tip:**
> To debug [scratch files](scratches.html) or scripts outside the project root, hold down the `Alt` (Windows), `Alt` (macOS), `Alt` (IntelliJ IDEA Classic (macOS)), `Alt` (macOS System Shortcuts), `Alt` (XWin), `Alt` (GNOME), `Alt` (KDE), `Alt` (Emacs), `Alt` (Sublime Text), `Alt` (Sublime Text (macOS)), `Alt` (Visual Studio), `Alt` (Visual Studio (macOS)), `Alt` (TextMate), `Alt` (NetBeans), `Alt` (Eclipse), `Alt` (Eclipse (macOS)) and `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (TextMate), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) keys before running the command (in this case, the dialog title is changed to Run in Context with Debug).

2. Right-click a script in the editor or project tool window, and select Debug 'script'.

Procedure: Debug an application using a specific run/debug configuration

1. Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (TextMate), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to invoke the Run Anything popup. Start typing the required configuration name and select it from the list. Then, hold down the `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (TextMate), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) key (the dialog title will be changed to Debug) and press `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)).

![Start debugging](https://resources.jetbrains.com/help/img/idea/2026.3/run_anything_debug_config.png)

> **Note:**
> Note that you can also use Run Anything to debug Ruby/Rails without previous configuring.

2. Click the ![Debug](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.startDebugger.svg) button on the toolbar to run the currently selected run/debug configuration.

![Debug selected configuration](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_code_config_toolbar.png)

3. Select the `Run | Debug` `Shift+F9` (Windows), `⌃ D` (macOS), `⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ D` (macOS System Shortcuts), `Shift+F9` (XWin), `Shift+F9` (GNOME), `Shift+F9` (KDE), `Shift+F9` (Emacs), `Shift+F9` (Sublime Text), `⌃ D` (Sublime Text (macOS)), `Alt+F5` (Visual Studio), `⌥ F5` (Visual Studio (macOS)), `Shift+F9` (TextMate), `Ctrl+F5` (NetBeans), `Alt+Shift+D` (Eclipse), `⌘ F11` (Eclipse (macOS)) command from the main menu and select the required configuration.

Procedure: Debug tests

* Learn how to start a debugging session for tests from the [Run tests](performing-tests.html) topic.

## Pause/Resume a debugger session

When the debugger session is running, you can pause/resume it as required using the buttons on the toolbar of the Debug tool window:

Procedure:

1. To pause a debugger session, click ![the Pause button](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.pause.svg).

2. To resume a debugger session, click ![the Resume button](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.resume.svg) `F9` (Windows), `⌘ ⌥ R` (macOS), `F9` (IntelliJ IDEA Classic (macOS)), `⌃ \` (macOS System Shortcuts), `F9` (XWin), `F9` (GNOME), `F9` (KDE), `F9` (Emacs), `F9` (Sublime Text), `F9` (Sublime Text (macOS)), `F5` (Visual Studio), `F5` (Visual Studio (macOS)), `Meta+F9` (TextMate), `F5` (NetBeans), `F8` (Eclipse), `F8` (Eclipse (macOS)).

Procedure: Restart a debugger session

* Click the  Rerun button in the Debug tool window or press `Ctrl+F5` (Windows), `⌘ R` (macOS), `⌃ F5` (IntelliJ IDEA Classic (macOS)), `⌘ R` (macOS System Shortcuts), `Ctrl+F5` (XWin), `Ctrl+F5` (GNOME), `Ctrl+5` (KDE), `Ctrl+F5` (Emacs), `Ctrl+F5` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+Shift+F5` (Visual Studio), `⌥ ⇧ F5` (Visual Studio (macOS)), `Ctrl+Alt+R` (TextMate), `Ctrl+F5` (NetBeans), `Ctrl+F11` (Eclipse), `Ctrl+F5` (Eclipse (macOS)).

![The Rerun button](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_rerun.png)

Procedure: Locate the process ID (PID) of the debug session

* To view the PID of the application you are currently debugging, hover over the corresponding session tab in the Debug tool window.

A tooltip appears that displays the PID of the debug session.

![A tooltip with process ID is shown on hovering a session tab in the Debug tool window](https://resources.jetbrains.com/help/img/idea/2026.3/rm_debug_show_pid.png)

## Terminate a debugger session

Procedure:

* Click ![the Stop button](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.suspend.svg) on the toolbar of the Debug tool window. Alternatively, press `Ctrl+F2` (Windows), `⌘ F2` (macOS), `⌘ F2` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ .` (macOS System Shortcuts), `Ctrl+F2` (XWin), `Ctrl+F2` (GNOME), `Ctrl+2` (KDE), `Ctrl+F2` (Emacs), `Ctrl+F2` (Sublime Text), `Ctrl+F2` (Sublime Text (macOS)), `Shift+F5` (Visual Studio), `⇧ F5` (Visual Studio (macOS)), `Ctrl+\` (TextMate), `Shift+F5` (NetBeans), `Ctrl+F2` (Eclipse), `⌘ F2` (Eclipse (macOS)) and select the process to terminate (if there are two or more of them).

