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
2
votes
2 answers

How do I get my text / cursor back when running a byebug session with Rails and the server times out?

I have a Rails (5.2.2.1) application on Ruby (2.6.2p47) with Puma as the local development server. When I am debugging using Byebug I find that when the Puma thread times out and resets, the consecutive Byebug sessions don't display the text of the…
radixhound
  • 2,190
  • 2
  • 18
  • 23
2
votes
1 answer

Adding blackboxed libraries to Pry debugging

Is it possible to "blackbox" libraries when using Pry? I like to walk the stack when I hit a breakpoint, but I really don't care about active-record transactions management and such. In fact, it even makes walking the stack completely useless…
2
votes
3 answers

Node.js Debugging flow

I'd like to debug node.js like rails. I've tried several ways: Webstorm debug – in this case I need to click "rerun debug" each time after code changed Nodemon with chrome remote debugger – in this case I need to reconnect to debugger each time…
Costa
  • 634
  • 3
  • 18
2
votes
1 answer

Byebug: Error when using "info locals/variables" for getting variables in current scope

I am new to rails and trying to debug my code. I am using byebug for it. The problem I am facing is that I want to know the variables in current scope but when I use any of these commands info locals info variables it shows the error *** Unknown…
shane
  • 33
  • 4
2
votes
1 answer

how do you change byebug history location

how can I tell byebug to log the history to /tmp/.byebug_history instead of it's default location. I tried looking in bye bug readme but didn't find an answer
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
2
votes
2 answers

Got "RuntimeError: Unable to find a spec satisfying byebug (>= 0)" after modifying Gemfile

I've created a new Rails application, then I ran bundle, and the bundle completed successfully. Then I modified the byebug entry from gem 'byebug', platform: :mri to gem 'byebug', platform: [:mri, :mingw, :x64_mingw] so that it works with…
garci560
  • 2,993
  • 4
  • 25
  • 34
2
votes
1 answer

Call stack "around" ruby code

I have a line of Ruby-code with overloading methods. I want to show the call stack of the line. I don't know the place for caller or byebug. I want to show the current call stack for the line after execution and find the place for debugging. How can…
ggoha
  • 1,996
  • 3
  • 23
  • 31
2
votes
1 answer

Rails skip byebug(s) for the rest of the execution

I am using inline byebug to stop the program execution and debug, from rails console or from a running rails server. I have to debug a very repetitive loop, and I need to put a byebug in the middle of that loop. After debugging, it seems my options…
Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
2
votes
2 answers

Ruby undefined local variable byebug

I'm executing the file app.rb in my rails project and trying to step through it using the byebug gem, but I get an error saying 'byebug' is an undefined local variable. I'm running the code using the command 'ruby app.rb'. Is there a different way…
user2974739
  • 619
  • 1
  • 7
  • 20
2
votes
0 answers

An error occurred while installing byebug (5.0.0), and Bundler cannot continue

Here are my program versions: Ruby 2.2.2p95 Rails 4.2.3 Installing byebug 5.0.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150719-7912-f08j1k.rb…
2
votes
2 answers

Need help getting rails server to work

So I feel incredibly frustrated. I am doing www.railstutorial.org and they require a very specific version of rails (4.2.2). I have installed it as they wanted. Put in their Gemfile specs on their "hello_app" app they provided. When I run "rails…
Erik Aasland
  • 167
  • 1
  • 11
2
votes
1 answer

How can you call the cucumber 'step' method while using pry-byebug?

I've got a collision between the step 'pseudo function' provided by the byebug debugger (specifically, I'm using pry-byebug), and the step function provided by cucumber for running arbitrary cucumber steps. I've tried to do my step function call…
Pathogen
  • 845
  • 11
  • 16
2
votes
3 answers

Step through code in minitest

I am wondering is there anyway to step through code in minitest? if I put byebug or debugger in my code and run the test that hits it, the tests run right through and dont stop. Is there anyway to stop the code and step through the way you do in…
BC00
  • 1,589
  • 3
  • 29
  • 47
2
votes
1 answer

This code works on one machine and fails on another. How to debug?

I have a function that looks like this: def search_street_addresses(query, limit: 100) if query.is_a? String query = @address_parser.parse(query) fail ArgumentError, "Invalid address string" if query.nil? end # ... And it's called…
Hubro
  • 56,214
  • 69
  • 228
  • 381
1
vote
1 answer

ruby help me trace the outcome

How come the outcome to this is 'a' the if statement should completely be skipped tbh (it's falsey?). ? Being there is no str[i-1] on the first iteration, it should throw an error, but it doesn't? When i trace through the steps using ByeBug it does…