Skip to content

Rails : Add debugging lesson for debugging rails using rdbg #30595

@XAJX179

Description

@XAJX179

Checks

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 of config/environments/development.rb
    • running - rdbg --open --nonstop -c rails s
  • show to how to attach the remote debugger console to the debuggee:
    • create default rdbg launch.json first.
    • go to Debug and Run Ctrl + Shift + D window in vscode and change debug current file with rdbg option to Attach with rdbg and click F5. (will automatically connect to the UNIX domain socket if only one is there)
    • add breakpoints and open the site in browser localhost:3000 and start debugging.
  • show how to use TCP/IP:
    • rdbg --open --port=38698 -c rails s or set RUBY_DEBUG_PORT=38698 environment variable.
    • setup launch.json for using port.
  • explain the options -c, --open and --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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleThis issue/PR has been inactive for over 30 days and will be closed if inactivity continues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions