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
1
vote
1 answer

How to examine ruby processes for performance problems?

I have an issue with a rails worker that is consuming extreme amounts of processor time. Oddly I have not been able to trace it out so far. I've tried to use New Relic, however I can't seem to trace it down within the worker itself. How can I…
ylluminate
  • 12,102
  • 17
  • 78
  • 152
1
vote
1 answer

Cannot start the debugger for the ruby program with Aptana Studio 3 in Windows

As the title of this question, I cannot start debugging my rb file in Aptana Studio 3. This is the output of the "Console" view: c:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find…
Hieu Le
  • 8,288
  • 1
  • 34
  • 55
1
vote
0 answers

Can't debug Watir scripts running under watir-classic (3.4.0)

I am developing Ruby scripts under Watir 4.0.2 so that I can test Internet Explorer under Watir-classic, and other browsers (e.g., FireFox) under Webdriver. If I set the environment variable 'WATIR_DRIVER=webdriver' I can breakpoint/debug my code…
1
vote
1 answer

Using capybara-firebug "stop and let me debug" in ruby 1.9.3

I have just upgrade to ruby on rails 3.0.9 from using rails 2.X. I have been writing feature tests in cucumber and used the capybara-firebug gem and specifically the included step stop and let me debug frequently to debug. However after the update I…
Martin Larsson
  • 1,008
  • 1
  • 8
  • 25
1
vote
2 answers

problems with jruby version of ruby-debug

This problem no longer exists. ruby-debug works fine in jruby these days Whenever I use 'n' to step over a line it steps into it instead. This happens to me on all the versions of jruby i've tried, the latest being 1.3.1 Does it work right for…
jshen
  • 11,507
  • 7
  • 37
  • 59
1
vote
1 answer

Debugging error in Rails app running on Webrick server

I am running a Rails app on the webrick server and wanted to get error messages to be displayed to me in the console. I installed the debugger 'gem install debugger' and the installation went off without a glitch but when I restarted the server by…
Subal Charla
  • 159
  • 2
  • 11
1
vote
0 answers

Debugger is choppy with Guard/Spork/Testunit

I am using ruby 1.9.2p318, rails 3.1.3, and the following gems: gem 'debugger' gem 'spork', '~> 0.9.0.rc' gem 'spork-testunit' gem 'guard-spork' When I just use spork in the terminal and run a test that includes a "debugger" line, everything works…
adamrneary
  • 645
  • 1
  • 7
  • 10
1
vote
1 answer

How to evaluate a multi-line block in ruby-debug console

I would like to evaluate def foo puts "you done got fooed" end in the ruby-debug console. It works fine fine with irb. But in ruby-debug, I can't get the reader to continue reading input after a newline. I've even tried ending the line in a…
event_jr
  • 17,467
  • 4
  • 47
  • 62
0
votes
1 answer

Ruby string comparison against regex capture

I'm new to ruby and it could be some basic stuff, but it just drives me crazy. How is the following possible? (rdb:1) display $2 26: $2 = "Alien" (rdb:1) display $2 == "Alien" 27: $2 == "Alien" = false (rdb:1) display $2.equal?…
Grozz
  • 8,317
  • 4
  • 38
  • 53
0
votes
1 answer

Why is jruby giving me this error when installing ruby-debug-ide?

Following is the error logs, $ jruby -S gem install ruby-debug-ide -v '0.4.16' Building native extensions. This could take a while... ERROR: Error installing ruby-debug-ide: ERROR: Failed to build gem native extension. "c:/Program…
Lieven Cardoen
  • 25,140
  • 52
  • 153
  • 244
0
votes
1 answer

ruby-debug not displaying correct line of code while listing code

I have the following software installed Ruby 1.8.6 Columnize 0.3.6 linecache 0.43 ruby-debug 0.10.4 ruby-debug-base 0.10.4 There is a piece of code that is almost 22,000 lines long. When rdebug moves to this piece of code, it executes…
Kevin
  • 557
  • 4
  • 18
0
votes
1 answer

ruby-debug not finding variables in rspec (in sinatra)

In my Gemfile I have (as per https://stackoverflow.com/a/8351945/111884) gem 'ruby-debug19', :require => 'ruby-debug' In my spec_helper.rb I have require 'ruby-debug' But when I put in debugger in my spec files, I can't seem to access any…
zlog
  • 3,316
  • 4
  • 42
  • 82
0
votes
1 answer

ruby-debug aborts sporadically while debugging cucumber scenarios for a rails app (maybe when I raise an exception)

I'm debugging some cucumber scenarios for a rails app, and ruby-debug is not behaving the way I expect. I have a debugger statement at the top of one of my failing steps, and when I do some routine debugging activities in the resulting debugger…
Big Bird
  • 257
  • 2
  • 9
0
votes
1 answer

Is there a way to set up a permanent configuration for ruby-debug?

I see in the ruby-debug docs configuration settings for ruby-debug here: http://bashdb.sourceforge.net/ruby-debug.html#Debugger_002esettings But there isn't any mention of creating a configuration file and having these settings set for new…
Jeremy Smith
  • 14,727
  • 19
  • 67
  • 114
0
votes
0 answers

How to make Minitest run a debugger on test failure?

I'd like Minitest to run a debugger when a test fails. I've tried the method described in this answer, but nothing happened. A failure message was displayed as usual, no debugger. I've also tried the method described in pry-rescue README:…
Paul T.
  • 61
  • 4