I'm trying to remote debug Ruby(on Rails) code in a Docker container with Visual Studio Code.
I do not have Ruby installed on my machine, just in Docker.
- VSCode: 1.32.3
- OS: Windows 10 Profesionnal, 1709
- Docker Desktop: 2.1.0.5 Community stable
- Docker: 19.03.5
- Ruby: 2.6.5
The procedure is as follows:
- Docker container executes command
bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- bin/rails s -b 0.0.0.0then "Fast Debugger (ruby-debug-ide 0.7.0.beta7, debase 0.2.3.beta3, file filtering is supported) listens on 0.0.0.0:1234" - I start debugging in VScode and Puma starts.
- I operate the application.
- Break points are not working.
However, VSCode indicates the line being executed when I pause debugging. After that I can step over and VARIABLES, WATCH and CALL STACK are working.
It seems that only BREAKPOINTS are not working.
Here is my file (snippets):
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot},
"remoteHost": "10.0.75.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "/var/work/app",
"showDebuggerOutput": true,
}
]
}
docker-compose.yml:
services:
app:
build: "./app"
depends_on:
- db
ports:
- "3000:3000"
- "1234:1234"
- "26162:26162"
volumes:
- "./app:/var/work"
stdin_open: true
tty: true
Gemfile.lock:
ruby-debug-ide (0.7.0)
debase (0.2.4.1)