January 2024
Intermediate to advanced
718 pages
20h 15m
English
Debuggers can also be quite powerful, and Ruby 3.1 came with a big improvement to Ruby’s standard debugger. The new debugger is distributed as a separate Ruby gem rather than part of the standard library:
| | $ gem install debug |
Note that the gem is named debug and not debugger. The debugger gem is a separate tool that hasn’t been maintained since 2015. Similarly, if you’re using Bundler, specify a version constraint of ">= 1.0.0" or else you’ll get a different, older gem. Global, permanent namespaces are fun!
After you have installed the debugger gem, there are a few different ways to start the debugger.
You can start your script with the command rdbg rather than ruby:
rdbg code/trouble/profileeg.rb
The script ...
Read now
Unlock full access