binding.pry not works with command bin/dev

Viewed 155

binding.pry not works(console input not available) if i start the server with bin/dev command. It only works with bin/rails s command. I understand it has something to do with foreman and Procfile.dev, but I don't know how. Is this a bug or is it supposed to be like this?

1 Answers

A popular approach is to use pry-remote which is useful in some ways I didn't expect: https://github.com/Mon-Ouie/pry-remote.

pry-remote opens a remote terminal, so where you drop your debugger line (binding.remote_pry in the case of pry-remote), you'll open another terminal and enter the debugging session by calling pry-remote in your shell.

I get this is a bit more complicated, I got used to it, and was able to get away from the noise logged by other process with Foreman.

Related