Overmind is a process manager for Procfile-based applications and tmux. With Overmind, you can easily run several processes from your Procfile in a single terminal.
So in the scenario where you have a Rails project with a
Profile file that is
run by foreman but you want to use a
binding.pry to debug some running code in the rails server, for example.
Putting the pry and seeing it in the foreman stack doesn’t work well, it doesn’t
stop or let you step through, so:
- one simple option is to run all the script separately, in different tabs of the terminal.
- use the gem
remote-pry(but then you have to install another gem in your repo, meh if unnecessary)
Procfile automatically with
If you have more than one
Procfile for some reason, specify which one
overmind start -f Procfile.dev.
Then in another tab, attach to the service you want, say for the rails server
web (whatever is the key in the
Procfile, usually, following
common patterns it will be
overmind connect web
At that point you’re gonna see the regular stack trace of the rails server.
If you kill it with control+C, it will kill the entire process, so check the manual for various extra flags and commands.
Thanks to Fer for this TIL!