microsoft / vscode-recipes

MIT License
5.86k stars 577 forks source link

debuggerPort does not work for Ruby on Rails debugging in VS Cod #291

Closed a21862 closed 2 years ago

a21862 commented 3 years ago

when I do "Ruby on Rails debugging in VS Code", the remote port "1234" is always used.

I tried to set "debuggerPort" to a different number, so I might launch a new vs code with another user account to debug a second rails app on the same remote server . However, it does not work. The below exception happens

Fatal exception in DebugThread loop: Address already in use - bind(2) for "127.0.0.1" port 1234 Backtrace: /home/user01/.rvm/gems/ruby-2.4.4/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:147:in initialize' from: /home/user01/.rvm/gems/ruby-2.4.4/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:147:innew' from: /home/user01/.rvm/gems/ruby-2.4.4/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:147:in block (2 levels) in _start_control_common' from: /home/user01/.rvm/gems/ruby-2.4.4/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:192:innotify_dispatcher_if_needed' from: /home/user01/.rvm/gems/ruby-2.4.4/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:146:in `block in _start_control_common'

Wondering, how can I set host and port parameters of rdebug-ide within VS Code ?

progpyftk commented 3 years ago

I had the same problem!

It has just worked here. SO: Windows.

Using the most recent versions of ruby-debug-ide and debase.

You just need to kill the process which is "using" the port 1234.

Windows: First find the PID: netstat -a -n -o | find ex: netstat -a -n -o | find "1234" then copy the PID number.

Kill the PID taskkill /PID /F