# Debug an application running with Foreman

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

[Foreman](https://github.com/ddollar/foreman) is a tool for managing `Procfile`-based applications. For example, you can run the Rails server alongside with `webpack-dev-server` to use live reloading:

```
web: rails server
webpacker:  ./bin/webpack-dev-server
```

In this topic, we'll show you how to create a separate run/debug configuration for running an application with Foreman, and how to debug this application.

## Prerequisites

Before working with Foreman, make sure that the 'foreman' gem is installed in the [project interpreter](configuring-language-interpreter.html).

## Create a configuration for running Foreman

First, we need to create a [configuration](run-debug-configuration.html) for running or debugging an application that uses Foreman. RubyMine doesn't have a dedicated run configuration for Foreman. We'll use the Gem Command configuration that provides the ability to execute commands of arbitrary gems.

Procedure:

1. In the main menu, go to `Run | Edit Configurations`, click ![the Add icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg), and select Gem Command from the list.

2. In the Run/Debug Configurations dialog, specify the following settings:

![Foreman run/debug configuration](https://resources.jetbrains.com/help/img/idea/2026.3/rm_foreman_configuration.png)

* Name: Enter the run/debug configuration name, for example, foreman start.

* Gem name: Specify the `foreman` gem here.

* Executable name: Select the `foreman` executable.

* Arguments: Specify an argument for running the application using Foreman, for example, `start`.

* Working directory: Specify your project directory.

Click OK.

3. In the Run/Debug Configurations dialog, switch to the Bundler tab and select the Disabled checkbox.

![Disabling bundle context for debugging with Foreman](https://resources.jetbrains.com/help/img/idea/2026.3/rm_disable_bundle_context.png)

## Debug the application

To debug the newly created foreman start configuration, follow the steps below:

Procedure:

1. Set breakpoints in your application.

2. 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 and type the configuration name in the invoked Run Anything popup: `foreman start`.

3. Press and 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 changes 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)).

4. Perform the required steps in your application to stop on a breakpoint. RubyMine will suspend the application execution before the breakpoint.

![Stop on a breakpoint](https://resources.jetbrains.com/help/img/idea/2026.3/rm_get_started_debug_stop_foreman.png)

