Skip to content

Instantly share code, notes, and snippets.

@nighttiger1990
Last active May 10, 2022 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nighttiger1990/ef542f77ecf19c4c6f81481fd7caa8f6 to your computer and use it in GitHub Desktop.
Save nighttiger1990/ef542f77ecf19c4c6f81481fd7caa8f6 to your computer and use it in GitHub Desktop.
How to setting debugging rails app in VSCode

Setting up

First install some package

gem install rebase ruby-debug-ide

edit launch.json to this

{
  // 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": [
    {
      "name": "Rails server",
      "type": "Ruby",
      "request": "launch",
      "program": "${workspaceRoot}/bin/rails",
      "pathToBundler": "~/.rbenv/shims/bundle",
      "pathToRuby": "~/.rbenv/shims/gem",
      "pathToRDebugIDE": "~/.rbenv/shims/rdebug-ide",
      "args": [
        "server"
      ]
    }
  ]
}
  • Note: How to find the path, we can use this command
which ruby
which rdebug-ide
which bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment