There is also the [debug](https://github.com/ruby/debug) gem (bundled with Ruby 3.1+) supports running as a standalone CLI. Use it like you would `ruby`.
```
rdbg script.rb
```
ref: https://github.com/ruby/debug?tab=readme-ov-file#invoke-the-program-from-the-debugger-as-a-traditional-debuggers