From 883b3e6ee6783009752454304bce36aa527f88e2 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sun, 28 Dec 2025 10:21:35 -0600 Subject: [PATCH] Add Run Dev Processes With Overmind Instead Of Foreman as a Rails TIL --- README.md | 3 +- ...cesses-with-overmind-instead-of-foreman.md | 46 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 rails/run-dev-processes-with-overmind-instead-of-foreman.md diff --git a/README.md b/README.md index 0ffce9b..2938f42 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1711 TILs and counting..._ +_1712 TILs and counting..._ See some of the other learning resources I work on: @@ -1167,6 +1167,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Rounding Numbers With Precision](rails/rounding-numbers-with-precision.md) - [Run A Rake Task Programmatically](rails/run-a-rake-task-programmatically.md) - [Run Commands With Specific Rails Version](rails/run-commands-with-specific-rails-version.md) +- [Run Dev Processes With Overmind Instead Of Foreman](rails/run-dev-processes-with-overmind-instead-of-foreman.md) - [Run Rails Console With Remote Dokku App](rails/run-rails-console-with-remote-dokku-app.md) - [Run Some Code Whenever Rails Console Starts](rails/run-some-code-whenever-rails-console-starts.md) - [Scaffold Auth Functionality With Rails 8 Generator](rails/scaffold-auth-functionality-with-rails-8-generator.md) diff --git a/rails/run-dev-processes-with-overmind-instead-of-foreman.md b/rails/run-dev-processes-with-overmind-instead-of-foreman.md new file mode 100644 index 0000000..bff4422 --- /dev/null +++ b/rails/run-dev-processes-with-overmind-instead-of-foreman.md @@ -0,0 +1,46 @@ +# Run Dev Processes With Overmind Instead Of Foreman + +Most Rails projects that I have worked on have used +[`foreman`](https://github.com/ddollar/foreman) as a development dependency for +running all the processes declared in your Procfile (`Procfile.dev`). As far as +having a single command to run everything (Rails server, asset building, +worker(s), etc.), it does the job. + +`foreman` has some serious points of friction though. The one that really stands +out to me is that when I try to debug the development Rails server with +`binding.irb` or `binding.pry`, the other processes tend to interfere. + +The alternative to `foreman` that I've been trying out recently is +[`overmind`](https://github.com/DarthSim/overmind). A specific selling point of +`overmind` is that it runs all the development processes in a `tmux` session. +That means you can individually connect to, inspect, and restart each process. + +Once you've installed `overmind` (`brew install overmind`), then you can easily +swap it in for `foreman` like so: + +```bash +$ overmind start -f Procfile.dev +``` + +You can connect to any of those processes directly: + +```bash +$ overmind connect sidekiq +``` + +When you want to `binding.irb` the Rails server, you can specifically connect to +the `web` process to do that. + +```bash +$ overmind connect web +``` + +If you need to stop all the process, you can run the `kill` subcommand. + +```bash +$ overmind kill +``` + +Lastly, if you have a `bin/dev` script in your project, it is probably using +`foreman`. If you and your team prefer `overmind`, then update that script +accordingly and you can simply run `bin/dev` going forward.