Byebug

Byebug is a simple to use, feature rich debugger for Ruby. It uses the
TracePoint API for execution control and the Debug Inspector API for call stack
navigation, so it doesn't depend on internal core sources. It's developed as a C
extension, so it's fast. And it has a full test suite so it's reliable.

It allows you to see what is going on inside a Ruby program while it executes
and offers many of the traditional debugging features such as:

Stepping: Running your program one line at a time.

Breaking: Pausing the program at some event or specified instruction, to
examine the current state.

Evaluating: Basic REPL functionality, although pry does a better job at
that.

Tracking: Keeping track of the different values of your variables or the
different lines executed by your program.

Build Status

Linux
macOS
Windows

Requirements

Required: MRI 2.2.0 or higher.

Recommended: MRI 2.3.0 or higher.

Install

gem install byebug

Or if you use bundler,

bundle add byebug --group "development, test"

Usage

From within the Ruby code

Simply drop

byebug

wherever you want to start debugging and the execution will stop there.
If you were debugging Rails, for example, you would add byebug to your code.

defindexbyebug@articles=Article.find_recentend

And then start a Rails server.

bin/rails s

Once the execution gets to your byebug command you will get a debugging prompt.

From the command line

If you want to debug a Ruby script without editing it, you can invoke byebug from the command line.

Semantic Versioning

Byebug tries to follow semantic versioning and tries to
bump major version only when backwards incompatible changes are released.
Backwards compatibility is targeted to pry-byebug and any other plugins
relying on byebug.