-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Rails : Add debugging lesson for debugging rails using rdbg #30595
Copy link
Copy link
Open
Labels
Status: StaleThis issue/PR has been inactive for over 30 days and will be closed if inactivity continuesThis issue/PR has been inactive for over 30 days and will be closed if inactivity continues
Description
Checks
- This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- I have thoroughly read and understand The Odin Project Contributing Guide
- Would you like to work on this issue?
Describe your suggestion
This issue is for proposing content on debugging rails applications using rdbg.
By the time people will get to Ruby on Rails course they would already have an idea about debugging current ruby file using vscode and setting up launch.json configuration. (releated issue : #30210 )
- show how to run application as a remote debuggee:
- adding
require 'debug/open_nonstop'to top ofconfig/environments/development.rb - running -
rdbg --open --nonstop -c rails s
- adding
- show to how to attach the remote debugger console to the debuggee:
- create default
rdbglaunch.jsonfirst. - go to
Debug and RunCtrl + Shift + D window invscodeand changedebug current file with rdbgoption toAttach with rdbgand click F5. (will automatically connect to the UNIX domain socket if only one is there) - add breakpoints and open the site in browser
localhost:3000and start debugging.
- create default
- show how to use TCP/IP:
rdbg --open --port=38698 -c rails sor setRUBY_DEBUG_PORT=38698environment variable.- setup
launch.jsonfor using port.
- explain the options
-c,--openand--nonstop.
If you don't want to stop the program at the beginning, you can also use require 'debug/open_nonstop'. Using debug/open_nonstop is useful if you want to open a backdoor to the application. However, it is also dangerous because it can become another vulnerability. Please use it carefully.
- explain why we should be careful with using it.
- assignment with links to README of https://github.com/ruby/vscode-rdbg?tab=readme-ov-file and https://github.com/ruby/debug?tab=readme-ov-file#use-rdbg-with-commands-written-in-ruby
No idea where we should introduce this lesson...maybe before deployment?
Path
Ruby / Rails
Lesson Url
https://www.theodinproject.com/lessons/ruby-on-rails-deployment
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: StaleThis issue/PR has been inactive for over 30 days and will be closed if inactivity continuesThis issue/PR has been inactive for over 30 days and will be closed if inactivity continues