---
title: Manage Your Ruby Processes with Overmind
url: https://sxnlabs.com/en/ruby/2023/11/03/manage-ruby-processes-overmind/
lang: en
date: '2023-11-03T16:30:00+02:00'
tags:
- Debugging
- Ruby
- Tools
---

# Manage Your Ruby Processes with Overmind

Ruby on Rails 7 has introduced a new executable `bin/dev`.
It won't be present by default unless you create a new application with the `--css` option or run the `css:install` command.

This file calls the [Foreman](https://github.com/ddollar/foreman) Gem which, in turn, executes the processes defined in the `Procfile.dev` at the root of your project.

This way of operating allows you to launch as many processes as you want in parallel, with a single command.

Here is an example of a `Procfile` from one of my projects.

```
web: bin/rails server -p 3000
css: bin/rails tailwindcss:watch
worker: bundle exec good_job start
guard: bundle exec guard
stripe: stripe listen --forward-to localhost:3000/pay/webhooks/stripe
```

All this works perfectly until the moment you need to debug your application with breakpoints.
Foreman does not allow you to access the debug console of a particular process.

This is where [Overmind](https://github.com/DarthSim/overmind) comes into play.
This program does exactly the same thing as Foreman while allowing you to connect to your processes.

Install Overmind on your machine as follows:

```bash
# on macOS (with homebrew)
$ brew install tmux

# on Ubuntu
$ apt-get install tmux
```

Then start your processes:

```bash
$ overmind s -f Procfile.dev
```

![Overmind server command](https://sxnlabs.com/images/posts/figures/2023-11-03/overmind-server.webp)

I will now put a breakpoint in a Rails controller of the _web_ process.

```ruby
class HomeController < ApplicationController
  def index
    debugger
    # ...
  end
end
```

From another terminal, but in the same directory (where your Procfile.dev is located), run the following command:

```bash
$ overmind c web
```

![Overmind connect command](https://sxnlabs.com/images/posts/figures/2023-11-03/overmind-connect.webp)

You can now access the Ruby console! 🎉

Of course, this feature is not limited to Ruby and works with any program/language.
