Skip to content

Instantly share code, notes, and snippets.

@mickzijdel
Last active May 19, 2025 07:06
Show Gist options
  • Select an option

  • Save mickzijdel/a1a987fb75cd3a52c772b18369778e59 to your computer and use it in GitHub Desktop.

Select an option

Save mickzijdel/a1a987fb75cd3a52c772b18369778e59 to your computer and use it in GitHub Desktop.
gem "rdbg" # Ruby debug integration
gem "foreman" # Necessary for the procfile to work
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "rdbg",
"name": "Run bin/dev & Attach with rdbg",
"request": "attach",
"preLaunchTask": "runBinDev",
"localfs": true,
"localfsMap": "${workspaceFolder}:${workspaceFolder}"
},
{
"type": "rdbg",
"name": "Attach with rdbg",
"request": "attach",
"localfs": true,
"localfsMap": "${workspaceFolder}:${workspaceFolder}"
},
]
}
web: RUBY_DEBUG_OPEN=TRUE RUBY_DEBUG_NONSTOP=TRUE rdbg --command --open --stop-at-load -- bundle exec bin/rails server
// .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "runBinDev",
"type": "shell",
"command": "bin/dev",
"isBackground": true,
"problemMatcher": [
{
"owner": "custom-rdbg-task",
"pattern": [
{
"regexp": "^.*DEBUGGER: Debugger can attach.*$",
"kind": "info",
"file": 1,
"location": 1,
"message": 0
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^.*DEBUGGER: Debugger can attach.*$",
"endsPattern": "^.*DEBUGGER: Debugger can attach.*$"
}
}
],
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"group": {
"kind": "build",
"isDefault": false
}
}
// If you have other tasks, they would be here
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment