Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby debugging

Gems

gem 'debugger', group: [:development, :test]

Debugging

  • Add debugger to anywhere in code that needs a breakpoint.
  • Refresh the page, the rails server terminal will stop, use help.
    • list or l show the line in code
    • pp is pretty print a variable
    • step, next/n, continue
    • irb to ruby shell

Other Tips

  • range = date.beginning_of_day..date.end_of_day

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.