Skip to content

Instantly share code, notes, and snippets.

@ashgkwd
Created May 6, 2024 03:12
Show Gist options
  • Save ashgkwd/d780292adad56b44150d6d558444d141 to your computer and use it in GitHub Desktop.
Save ashgkwd/d780292adad56b44150d6d558444d141 to your computer and use it in GitHub Desktop.
VS Code launch.json for Rails app debugging with ruby_lsp
{
"version": "0.2.0",
"configurations": [
{
"type": "ruby_lsp",
"name": "Rails",
"request": "launch",
"program": "${workspaceRoot}/bin/rails s",
"env": {
"RAILS_ENV": "development"
}
},
{
"type": "ruby_lsp",
"name": "Debug script",
"request": "launch",
"program": "ruby ${file}"
}
]
}
@ashgkwd
Copy link
Author

ashgkwd commented May 6, 2024

Once you create this file in your project, press F5 to start the debug. You can enable capture Runtime Exceptions or all exceptions. Also, you can manually add breakpoints (red dot on right side of line number)

Screenshot 2024-05-05 at 11 08 45 PM

@ashgkwd
Copy link
Author

ashgkwd commented May 6, 2024

A complete article is coming on ashgaikwad.substack.com

💡 Subscribe now to receive it in your inbox for free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment