Description
Using a fresh Rails project, I'm unable to start debugging the Rails server using Zed's new debugger. If I instead use the just added "attach" functionality done as part of #124, things work great.
Reproduction Steps
- Install Ruby and Rails
- Create a new Rails project with
rails new example_project
- Create a
.zed/debug.json with the following configuration
[
{
"request": "launch",
"adapter": "rdbg",
"label": "Launch Rails Server with Ruby extension (Debug)",
"command": "bin/rails"
}
]
- Start debugging using that task. The console will show a cryptic
error:
error: process exited before debugger attached.
Attempted Debugging Steps
I modified the extension to print out the command and arguments that it was going to use to launch the debugging session. I then ran that same command in a terminal. It was able to start successfully and I was able to attach using rdbg -A -p <port> -h <host>. One odd thing I did notice is that the host was a integer, rather than the typical IPv4 octet style. rdbg doesn't seem to mind this though, so long as you pass the same integer to the attach request.
Known Workarounds
- If you install the latest code from
main, start the Rails server with rdbg -o -p 12345 -c -- bin/rails s and use the following debug config, all works well.
{
"label": "Attach to Rails server",
"adapter": "rdbg",
"request": "attach",
"cwd": "$ZED_WORKTREE_ROOT",
"env": {
"RUBY_DEBUG_PORT": "12345"
}
},
- The built-in Ruby adapter in Zed seems to handle the same JSON config in the repro steps just fine, so something seems to be different between the two, though I'm not sure what.
Description
Using a fresh Rails project, I'm unable to start debugging the Rails server using Zed's new debugger. If I instead use the just added "attach" functionality done as part of #124, things work great.
Reproduction Steps
rails new example_project.zed/debug.jsonwith the following configuration[ { "request": "launch", "adapter": "rdbg", "label": "Launch Rails Server with Ruby extension (Debug)", "command": "bin/rails" } ]Attempted Debugging Steps
I modified the extension to print out the command and arguments that it was going to use to launch the debugging session. I then ran that same command in a terminal. It was able to start successfully and I was able to attach using
rdbg -A -p <port> -h <host>. One odd thing I did notice is that the host was a integer, rather than the typical IPv4 octet style. rdbg doesn't seem to mind this though, so long as you pass the same integer to the attach request.Known Workarounds
main, start the Rails server withrdbg -o -p 12345 -c -- bin/rails sand use the following debug config, all works well.{ "label": "Attach to Rails server", "adapter": "rdbg", "request": "attach", "cwd": "$ZED_WORKTREE_ROOT", "env": { "RUBY_DEBUG_PORT": "12345" } },