- In a terminal: run
rails debug
- In VS Code: Debug > select Listen for rdebug-ide > Play
Last active
October 20, 2019 02:36
-
-
Save afmicc/f5d78deb5e65f17971ebd99a4676e74b to your computer and use it in GitHub Desktop.
VS Code debug Ruby on Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/debug.rake | |
if Rails.env.development? | |
task :debug do | |
sh 'bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 1234 -- bin/rails s' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :development do | |
gem 'debase' | |
gem 'ruby-debug-ide' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .vscode/launch.json | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for rdebug-ide", | |
"type": "Ruby", | |
"request": "attach", | |
"remoteHost": "127.0.0.1", | |
"remotePort": "1234", | |
"remoteWorkspaceRoot": "${workspaceRoot}" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment