Questions tagged [byebug]

Byebug is a simple to use, feature rich debugger for Ruby 2.0.

Byebug is a Ruby 2.0 debugger. It's implemented using the Ruby 2.0 TracePoint C API for execution control and the Debug Inspector C API for call stack navigation. The core component provides support that front-ends can build on. It provides breakpoint handling and bindings for stack frames among other things and it comes with an easy to use command line interface.

When your code is behaving in unexpected ways, you can try printing to logs or the console to diagnose the problem. Unfortunately, there are times when this sort of error tracking is not effective in finding the root cause of a problem. When you actually need to journey into your running source code, the debugger is your best companion.

The debugger can also help you if you want to learn about the Rails source code but don't know where to start. Just debug any request to your application and use this guide to learn how to move from the code you have written deeper into Rails code.

Homepage

Guide

119 questions
4
votes
1 answer

byebug, next into application code only

When I press n (or type next) in a Rails app, very often I get into a gem's methods that I'm not interested in, and I have to press n lots of times just to continue execution. Is there a way, beside filling my code with byebug calls, to just stay in…
John Smith
  • 1,726
  • 2
  • 18
  • 30
3
votes
0 answers

Firendly backtrace (where command) with ruby byebug

I use byebug to know the origin of a specific call, but when I use where I get the full backtrace. Is there a way to filter the where command to show only my code? For example this, is a typical where result, it shows 127 lines but I would like to…
Albert Català
  • 2,026
  • 2
  • 29
  • 35
3
votes
1 answer

Rails debugger exits automatically after some interval, and Ubuntu terminal tab hangs

I am using byebug for debugging my rails application.Debugger stops but continues automatically after some time interval and gives this: [5188] ! Terminating timed out worker: 5378 Worker 0 (pid: 5959) booted, phase: 0 and also when sometimes it…
Param
  • 31
  • 5
3
votes
2 answers

Byebug fully supports Windows or not?

My environment is macOS and I don't have Windows environment. I am writing a blog post about Byebug and I want to know if it fully supports Windows or not. Here is information I got: Might not work? Rails 5 adds platform: :mri option to byebug gem.…
Junichi Ito
  • 2,438
  • 1
  • 23
  • 46
3
votes
3 answers

Breakpoints with pry-byebug don't trigger in the console

I'm trying to use pry and pry-byebug to step through the execution of some code in a Rails console. I started the console with pry -r ./config/environment I then set a breakpoint: break Foo#bar Then make a new Foo and call bar on it: Foo.new.bar I…
Kevin Griffin
  • 14,084
  • 7
  • 28
  • 23
3
votes
0 answers

Reloading rake task methods from byebug

I use byebug debugger to pause execution of a rather lengthy rake task and inspect objects. Is it possible to add a new completely method and somehow reload the rake task's code while I'm in byebug? For example, add a new method, reload byebug,…
Alex
  • 453
  • 5
  • 14
3
votes
1 answer

Pry-Remote not triggered Rails 4

Problem: After upgrading to Rails 4 in another branch and trying the solution that worked last time Pry-Remote with Pow on Rails 4 . I'm still finding difficulty with the new Rails 4 and Pry Debugger. What's I'm running: rvm 1.26.11 (latest) by…
FastSolutions
  • 1,809
  • 1
  • 25
  • 49
3
votes
1 answer

Rails: cannot load such file -- byebug/byebug (LoadError)

Has anyone seen a similar issue? . I have Windows 8. Every time I do any 'generate scaffold` I get the error below. I'm getting this error in most of my projects, often at various steps but always with…
Simon Ioffe
  • 25
  • 1
  • 4
3
votes
1 answer

ByeBug remote won't hit breakpoints with Unicorn

I launch unicorn through foreman, so the debugger prompt is swallowed. I've had luck with the debugger gem in the past connecting as a remote debugger. We're about to upgrade to Ruby 2.1.2 which, as I understand it, is not compatible with…
Tim W
  • 383
  • 2
  • 10
3
votes
1 answer

How do I scale the stack when debugging with byebug?

I'm currently getting an error that looks like this: NoMethodError: undefined method `debug' for nil:NilClass /mnt/hgfs/Dropbox/Company/Project/lib/project/misc.rb:23:in `debug' …
Hubro
  • 56,214
  • 69
  • 228
  • 381
3
votes
1 answer

How can I drop to byebug on MiniTest errors?

I'm using Ruby 2.0 with MiniTest. I'd like to drop to byebug if an error occurs during the test so that it can be easily debugged. Is it possible to override MiniTest's default action on error?
Hubro
  • 56,214
  • 69
  • 228
  • 381
2
votes
1 answer

Erro runing byebug 8.2.1 Mac M1

I'm new to ror and I want to run a project, but I can't because I have a problem with the byebug gem, I searched many forums but none of them solve my problem Ruby 2.3.1 with rbenv Rails 4.2.2 MacBook Air M1 thanks in…
2
votes
1 answer

Make errors while installing byebug gem

I am trying to install byebug and it keeps giving me this error: make: *** No rule to make target…
Ducklett
  • 63
  • 5
2
votes
1 answer

No SQL logs from ActiveRecord with byebug in test mode

Byebug with ActiveRecord in Rails 6 is not logging as expected in my test environment. When I run a test and use byebug to pause execution ActiveRecord is not logging queries to the console. For example, if I type Candidate.second I see no SQL…
Matt
  • 5,800
  • 1
  • 44
  • 40
2
votes
1 answer

What's byebug's version of pry's whereami?

In Ruby, we have a gem called byebug and a gem called pry. In pry, you can type whereami to see where you are, when you are in a binding.pry session. How do you do the same thing in byebug?
Henry Yang
  • 2,283
  • 3
  • 21
  • 38