Configuring VS Code to use ruby debugger on WSL

2.1k Views Asked by At

I'm relatively new to using a terminal and programming in general. Here's the error I'm currently getting when hitting the 'start debugging' button is VS Code:

Debugger terminal error: Process failed: spawn ~/.rvm/gems/ruby-2.3.4/bin/rdebug-ide.bat ENOENT

My setup is bash on ubuntu (WSL) on Win10 10.0.16299. I have the VS Code 1.21.1 integrated terminal set up to use zsh.

Here's the steps I've taken so far:

  1. installed the ruby extension for VS Code
  2. inside VS Code integrated terminal, I ran gem install ruby-debug-ide -v 0.7.0.beta3
  3. gem install debase -v 0.2.2
  4. According to the answer here, I created a .bat file at ~/.rvm/gems/ruby-2.3.4/bin/rdebug-ide.bat
  5. added this to my launch.json inside vs code for the debuggers:

{

        "name": "Debug Local File",
        "type": "Ruby",
        "request": "launch",
        "cwd": "${workspaceRoot}",
        "program": "${file}",
        "pathToRDebugIDE": "~/.rvm/gems/ruby-2.3.4/bin/rdebug-ide.bat",

},

It seems that I might need to use the actual windows path of rdebug-ide.bat instead of the WSL path, but I've heard that it's bad to root around inside the WSL folder on windows. I figured I'd ask here first in case I'm taking the wrong steps to fix this, or if using the actual windows path might mess things up.

0

There are 0 best solutions below