Setup the Ruby 3.0.0 debugger in VSCode


First install the Ruby extension in VSCode.

Then Install the Ruby debug IDE package:

gem install ruby-debug-ide

You will also need the debase package. Be sure to install the pre release to avoid a bug when running the debugger:

gem install --pre debase

Then add a launch configuration for the VSCode debugger (replace file.rb and your username):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "program": "${workspaceRoot}/file.rb",
            "env": {
                "PATH": "/usr/local/bin:/usr/bin:/usr/local/sbin:/home/username/.local/share/gem/ruby/3.0.0/bin",
                "GEM_HOME": "/home/username/.local/share/gem/ruby/3.0.0/",
                "GEM_PATH": "/usr/bin/gem",
                "RUBY_VERSION": "3.0.0"
              }
              
        }
    ]
}

Click the « Start Debugging » button or press F5 to run the debugger.