Remote debugging in Rails 7
This post was extracted and adapted from The Rails and Hotwire Codex.
Rails 7 includes the official Ruby debugger. It also uses Foreman to orchestrate multiple processes in development. This way you can run the Rails server along with processes to watch and compile your frontend assets using a single command.
Annoyingly, this makes debugging trickier. You can't just add a breakpoint in your app and run commands in the console. The same Terminal window is running multiple processes, so won't always be interactive.
debuggem supports remote debugging which is useful in such cases. Using this setup…