Questions tagged [ruby-debug]

The purpose of a debugger ruby-debug is to allow you to see what is going on “inside” a Ruby program while it executes.

The purpose of a debugger ruby-debug is to allow you to see what is going on “inside” a Ruby program while it executes.

It can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:

  • Start your script, specifying anything that might affect its behavior.
  • Make your script stop on specified conditions.
  • Examine what has happened, when your script has stopped.
  • Change things in your script, so you can experiment with correcting the effects of one bug and go on to learn about another.

Link

Related tag

152 questions
3
votes
1 answer

Why does "block_given?" return false in debugger? (Works correctly when not debugging)

On testing with ruby debugger block_given? gives false but still executes, can someone explain me how its executed?.It is anything related to context(Is debugger changing context)? if yes then how to find current context. Now instead of ruby-debug…
Amar
  • 6,874
  • 4
  • 25
  • 23
3
votes
2 answers

Rails, Capybara.using_session(...), visiting a page, and having ruby-debug causes rspec suite seem to hang after run even though all specs passing

Rails 7.0.4 Rspec 3.11.0 Capybara 3.37.1 selenium-webdriver (gem) 4.5.0 with Ruby-debug (gem 'debug', platforms: %i[ mri mingw x64_mingw ]) in Gemfile whenever I try to add Capybara.using_session call, my suite hangs. it hangs after it completes all…
Jason FB
  • 4,752
  • 3
  • 38
  • 69
3
votes
1 answer

Puma causes Ruby 3 Debug to show ANSI escape sequences when pressing arrow keys (Mac ZSH)

I'm on Mac OS 12.3.1 using Z shell. When using the Ruby Debug gem (1.5) in Puma 5.6.4 with Ruby 3.0.0 the arrow keys do not work and instead print out the ANSI escape sequences (e.g. ^[[A for up). If I understand correctly, Puma is running on…
Jonathan
  • 61
  • 4
3
votes
1 answer

rdebug-ide with VSCODE returns cannot load such file -- /app/app/rails error

I have a dockerized RoR app and I'm trying to run it in debug mode using rdebug-ide and vscode. Already added gems ruby-debug-ide and debase. I installed ruby extension on vscode and created the launch config: "version": "0.2.0", "configurations":…
3
votes
4 answers

Can install gem ruby-debug, but rails server can't find it

I found a pretty interesting problem installing ruby gems bluehat@Matapan:~/code/Amacron$ rails server --debugger => Booting WEBrick => Rails 3.0.3 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to…
Katy Levinson
  • 777
  • 1
  • 6
  • 15
3
votes
8 answers

Installing ruby-debug19 locally

I'm currently running Ruby 1.9.2p0 on a Windows XP 32-bit machine. Ever since we've upgraded to Ruby 1.9, I cannot get any form of debugging to work at all. I've been told that you need the new ruby-debug19 gem in order to get things running. …
Klam
  • 505
  • 1
  • 5
  • 11
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
2 answers

frame, thread, and some other jargons in ruby-debug gem, what do they mean?

I am now trying to learn ruby-debug gem, but there are many jargons I am unable to catch up. Wondering if anyone could help with the explanations? I couldn't find them in http://bashdb.sourceforge.net/ruby-debug.html either. The author assumed we…
jaycode
  • 2,926
  • 5
  • 35
  • 71
3
votes
1 answer

Rails: Ruby debugger shows old code unless I stop the server and start it again

Using ruby-debug, when I issue a list command, it shows old code. So if I update the code surrounding (especially before) the debugger command in the model it still shows the old code. The only way I have found to 'refresh' this code is by stopping…
Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
3
votes
1 answer

Ruby debugger won't step over

using ruby-debug in rspec (through rspec -d), the debugger refuses to step over statements when I execute "next" It seems to always step into the statement debugger params[:appointment][:user_id] = User.where(email:…
lostinplace
  • 1,538
  • 3
  • 14
  • 38
3
votes
0 answers

Why can't I set a breakpoint in ruby-debug with jruby

I trying to set breakpoint in ruby-debug when run on jruby. first I get error some like in this post Why can't I set a breakpoint in ruby-debug? I patched linecache like Mashmagar say. First error disappear. And now I get another error 21582:…
dpa
  • 427
  • 4
  • 16
3
votes
3 answers

Can't install ruby-debug?

Has anyone else encountered this? gem install ruby-debug Building native extensions. This could take a while... ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. …
WebQube
  • 8,510
  • 12
  • 51
  • 93
3
votes
3 answers

Debugging rake tasks

I added debugger and require 'ruby-debug' in my task to debug it. When I run my task from the console, it does hit the debugger, but doesn't let me inspect any variables. For example, if there's a line in my task : my_var = 1 + 2 and I type my_var…
Myxtic
  • 5,679
  • 5
  • 48
  • 69
3
votes
3 answers

Can't install ruby-debug, error: rb_method_entry_t.called_id

I'm trying to install ruby-debug. I'm using Mac OS 10.7.4, XCode version 2308, and Ruby version 1.9.3-p194. Following the instructions here: http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug, I tried…
andrewhl
  • 992
  • 1
  • 11
  • 31
3
votes
1 answer

Aptana 3 and ruby debugging

How I can set the watch on variable's in ruby. I am using Aptana as IDE. I am coming for .NET and am used to seeing the variable values just by hovering over the variable. In aptana 3 i cant find way through which i see current state and values of…
Gainster
  • 5,481
  • 19
  • 61
  • 90