ruby / vscode-rdbg

VSCode Ruby rdbg Debugger
MIT License
180 stars 51 forks source link

Issue "Can not find attachable Ruby process." with VSCode (on MacOS Sonoma) #407

Closed mscdit closed 10 months ago

mscdit commented 10 months ago

Hi,

I am using VSCode 1.85.1 on macOS Sonoma and wanna debug a rails project. I run gem install debug and a which rdbg tells me that rdbg (1.9.1) should be right version from my asdf installation of ruby and rails (in /Users/XXX/.asdf/shims/rdbg).

After starting VSCode I run bundle exec rdbg --open -n -c -- bundle exec rails s which tells me (in first line of Terminal output) that

DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/5d/3_3p6jn50yd6qf_0648v_93w0000gn/T/ruby-debug-sock-501/ruby-debug-XXX-52985)

which looks fine/normal to me. With the following .vscode/launch.json

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "rdbg", "name": "Debug current file with rdbg", "request": "launch", "script": "${file}", "args": [], "askParameters": true }, { "type": "rdbg", "name": "Attach with rdbg", "request": "attach" } ] }

I run into the problem that I am getting error message "Can not find attachable Ruby process." in VSCode (by pressing "attach with rdbg"). Any ideas what I am missing?

THX a lot! mscdit

ko1 commented 10 months ago

DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/5d/3_3p6jn50yd6qf_0648v_93w0000gn/T/ruby-debug-sock-501/ruby-debug-XXX-52985)

It seems older debug.gem (~ 1.8.x). Could you try bundle exec rdbg -v?

mscdit commented 10 months ago

Thanks a lot! bundle exec rdbg -v shows 1.6.3 ... and rdbg -v 1.9.1 ... updating bundle did the trick. It is working now!

ko1 commented 10 months ago

Great!