Skip to content
Debugging in Ruby 2
Ruby C Other
Branch: master
Clone or download

Latest commit

Latest commit a518903 Feb 4, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
.bundle Commit a bundler config file (#633) Jan 18, 2020
.github Use latest docker in CI (#643) Jan 24, 2020
bin Use bundler 2.1.4 (#630) Jan 16, 2020
docker Commit a bundler config file (#633) Jan 18, 2020
exe exe/byebug: drop relative require (#650) Feb 4, 2020
ext/byebug Fix argc of rb_define_singleton_method for dt_inherited (#612) Dec 22, 2019
lib Get ready for 11.1.1 release (#636) Jan 23, 2020
tasks Bump base alpine image Sep 1, 2019
test test: drop usage of require_relative to code in lib (#649) Feb 4, 2020
.clang-format Move to clang-format for C code formatting Dec 2, 2017
.codeclimate.yml Disable the rest of codeclimate checks Jul 25, 2018
.gitignore Commit a bundler config file (#633) Jan 18, 2020
.mdlrc Normalize string literals in mdlrc config Jan 6, 2018
.rubocop.yml Bump rubocop from 0.76.0 to 0.78.0 (#610) Dec 22, 2019
.simplecov Fix rubocop config to include `.simplecov` Jan 6, 2018 Get ready for 11.1.1 release (#636) Jan 23, 2020 Simplify bundler binstub May 21, 2019 Add `skip` command (#377) Jan 20, 2019
Gemfile Add rexml as a dependency temporarily (#629) Jan 15, 2020
Gemfile.lock Get ready for 11.1.1 release (#636) Jan 23, 2020
LICENSE Update email address in license and coc Sep 19, 2018 Readme: add new commands (#628) Jan 15, 2020
Rakefile Login before pushing image Dec 29, 2018 Drop official support for ruby 2.2 Dec 30, 2017
appveyor.yml Drop ruby 2.3 support (#554) Apr 27, 2019
byebug.gemspec Use `require_relative` when possible (#583) Sep 5, 2019 Update email address in license and coc Sep 19, 2018


Version Tidelift Coverage Gitter

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

The debugger permits the ability to understand 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.

For enterprise

Byebug for enterprise is available via the Tidelift Subscription. Learn more.

Build Status

Linux Windows Vey


  • Required: MRI 2.4.0 or higher.
  • Recommended: MRI 2.6.4 or higher (MRI 2.6.0 to 2.6.3 contain a regression causing unbalanced call/return events in some cases, breaking the next command).


gem install byebug

Alternatively, if you use bundler:

bundle add byebug --group "development, test"


From within the Ruby code

Simply include byebug wherever you want to start debugging and the execution will stop there. For example, if you were debugging Rails, you would add byebug to your code:

def index
  @articles = Article.find_recent

And then start a Rails server:

bin/rails s

Once the execution gets to your byebug command, you will receive 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.

byebug myscript.rb

Byebug's commands

Command Aliases Subcommands
backtrace bt w where
break b
catch cat
condition cond
continue c cont
continue! c! cont!
delete del
disable dis breakpoints display
display disp
edit ed
enable en breakpoints display
finish fin
frame f
help h
history hist
info i args breakpoints catch display file line program
interrupt int
list l
method m instance
next n
quit q
quit! q!
save sa
set autoirb autolist autopry autosave basename callstyle fullpath histfile histsize linetrace listsize post_mortem savefile stack_on_error width
show autoirb autolist autopry autosave basename callstyle fullpath histfile histsize linetrace listsize post_mortem savefile stack_on_error width
skip sk
source so
step s
thread th current list resume stop switch
tracevar tr
undisplay undisp
untracevar untr
var v all constant global instance local

Semantic Versioning

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

Getting Started

Read byebug's markdown guide to get started. Proper documentation will be eventually written.

Related projects

  • pry-byebug adds next, step, finish, continue and break commands to pry using byebug.
  • ruby-debug-passenger adds a rake task that restarts Passenger with Byebug connected.
  • minitest-byebug starts a byebug session on minitest failures.
  • sublime_debugger provides a plugin for ruby debugging on Sublime Text.
  • atom-byebug provides integration with the Atom editor [EXPERIMENTAL].


See Getting Started with Development.


Subscribe to Tidelift to ensure byebug stays actively maintained, and at the same time get licensing assurances and timely security notifications for your open source dependencies.

You can also help byebug by leaving a small (or big) tip through Liberapay.

Security contact information

Please use the Tidelift security contact to report a security vulnerability. Tidelift will coordinate the fix and disclosure.


Everybody who has ever contributed to this forked and reforked piece of software, especially:

  • @ko1, author of the awesome TracePoint API for Ruby.
  • @cldwalker, debugger's maintainer.
  • @denofevil, author of debase, the starting point of this.
  • @kevjames3 for testing, bug reports and the interest in the project.
  • @FooBarWidget for working and helping with remote debugging.
You can’t perform that action at this time.