5

Background

I have ruby-debug-ide all setup to remote debug (I'm using Docker) in Visual Studio Code. I am using this command in my docker-compose.yml to start ruby-debug-ide and my rails server:

rm -f /api/tmp/pids/server.pid && rdebug-ide --host 0.0.0.0 --port 1234 -- bin/rails server --port=3000 --binding=0.0.0.0

and then in vscode I have this launch.json script:

{
  "name": "Listen for rdebug-ide",
  "type": "Ruby",
  "request": "attach",
  "cwd": "${workspaceRoot}",
  "remoteHost": "127.0.0.1",
  "remotePort": "1234",
  "remoteWorkspaceRoot": "/app",
  "showDebuggerOutput": true
}

and when I go to vscode and start that launch.json script, my rails server starts up as well as the debugger. But when I stop/detach the launch.json script, the rails server dies.

My Question

Is there a way to start my Rails server and ruby-debug-ide independently? I want to be able to access my Rails application when I am not debugging. Is it possible to do something like this:

# start my rails server
rm -f /api/tmp/pids/server.pid && bin/rails server --port=3000 --binding=0.0.0.0

# also start rdebug-ide and wait for something (vscode) to attach to it later on
rdebug-ide --host 0.0.0.0 --port 1234 -- <attach_to_my_rails_server>
james
  • 5,006
  • 8
  • 39
  • 64
  • 1
    Apparently it is a feature requested -> https://github.com/rubyide/vscode-ruby/issues/125 but not yet implemented – Raphael Pr Oct 08 '18 at 08:11

1 Answers1

0

Did you tried this: rdebug-ide --host 0.0.0.0 --port 1234 -- bin/rails s -b 0.0.0.0

Nezir
  • 6,727
  • 12
  • 54
  • 78
  • Yes, that was my first attempt. `rdebug-ide --host 0.0.0.0 --port 1234 -- bin/rails server --port=3000 --binding=0.0.0.0` and then my rails app wouldn't start until i attached the debugger. – james Oct 08 '18 at 13:16