I'm trying to set a breakpoint in a Rails application from VSCode on a Mac. I'm using ASDF to install Ruby etc.
The default launch configuration in VSCode for Rails looks like this:
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
]
}
That fails because my which rails
is Users/timregan/.asdf/shims/rails
. But if I replace "program": "${workspaceRoot}/bin/rails"
in the launch.json with "program": "/Users/timregan/.asdf/shims/rails"
I get this error message when I try to launch a debugging session:
Uncaught exception: /Users/timregan/.asdf/shims/rails:3: unknown regexp options - hbrw exec /opt/homebrew/opt/asdf/libexec/bin/asdf ex... ^~~~~~~~~ /Users/timregan/.asdf/shims/rails:3: syntax error, unexpected local variable or method, expecting `do' or '{' or '(' .../opt/asdf/libexec/bin/asdf exec "rails" "$@" ... ^~~~ /Users/timregan/.asdf/installs/ruby/3.0.3/bin/rdebug-ide:25:in `load' /Users/timregan/.asdf/installs/ruby/3.0.3/bin/rdebug-ide:25:in `'
What is the correct setting to use in VSCode's launch.json to debug Rails when using ASDF?