Foreman: Cannot read echo when using byebug or debugger tool

Created on 27 Feb 2018  路  9Comments  路  Source: ddollar/foreman

Hello,

I am using foreman alongside a debugger tool inside of Ruby on Rails applications. Foreman is managing my puma server, redis-server, workers, and mailcatcher.

When I use a debugger tool alongside foreman, I cannot read the echo of my commands. This becomes really frustrating during the debugging process.

Can anyone please help?

Most helpful comment

Still an issue

All 9 comments

I am also experiencing this issue. In the debugger, I am not able to see what I am typing.

Yep, there's a closed issue #58 here with some old stuff about using pry-remote. But haven't been able to get it to work yet

I've faced a similar problem and looks like I've found a good workaround - https://github.com/kimmobrunfeldt/concurrently
So all you need is to write a script that feeds arguments to it.

Here is my example:
concurrently -p '[{name}]' --handle-input -n back,front -c 'black.bgGreen,black.bgCyan' 'rails s' 'bin/webpack-dev-server'

Here is how it looks like:
2018-11-20 17 21 06

PS most important flag here is --handle-input. Debugging just works

@thedon-chris Is this still an issue?

Still an issue

banged my head around this for a while then realized ... wait... I can just use 2 terminal tab, one for webpack-dev-server and one for rails. Duh.

@dchersey You can also try the following if you want them on one terminal:
./bin/webpack-dev-server & bundle exec rails s && fg

You still see the output of both, with rails being the main process (so it accepts input etc in pry)

Ever since I found this I stopped bothering with foreman.

Only caveat is you need to CtrlC twice to close both programs, but it doesn't really matter.

banged my head around this for a while then realized ... wait... I can just use 2 terminal tab, one for webpack-dev-server and one for rails. Duh.

When I want to debug I usually do this. When working in normal flow, keep using Foreman.

If it helps anyone here, I created a program https://github.com/LoganBresnahan/meow that utilizes GNU's fg to manage my commands and let's me run commands automatically in different terminal tabs. Foreman is a great gem and I stumbled here trying to solve my own issues with pry. My program is just shell scripts and after figuring out file descriptors pry will work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corydolphin picture corydolphin  路  30Comments

dunkstewart picture dunkstewart  路  12Comments

justin808 picture justin808  路  6Comments

rvanlieshout picture rvanlieshout  路  3Comments

jt2190 picture jt2190  路  9Comments