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
172
votes
6 answers

Install autoreconf on OS X v10.7 (Lion)?

I'm attempting to re-install Ruby 1.9.3 with a patch that will allow me to use ruby-debug. When following the instructions and running rvm reinstall 1.9.3 --patch debug --force-autoconf It runs through and after applying the patch spits out: rvm…
Brian
  • 7,204
  • 12
  • 51
  • 84
85
votes
5 answers

Running ruby debug in rspec?

I'm trying to get Ruby debugger running in one of my specs: describe User do it "should be valid" do debugger User.new.should be_valid end end When I run rspec though, I get: debugger statement ignored, use -d or --debug option to…
Allyl Isocyanate
  • 13,306
  • 17
  • 79
  • 130
70
votes
9 answers

ruby-debug with Ruby 1.9.3?

I just updated to Ruby 1.9.3p0 and Rails 3.1.1. Now when I try to launch the server, it complains that I should install ruby-debug, even though it's already installed. % rails server --environment=development --debug => Booting WEBrick => Rails…
dkobozev
  • 2,265
  • 2
  • 21
  • 21
52
votes
7 answers

Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)'

I have standard ruby-head and Rails 3.1rc4. I installed ruby-debug with following instructions from http://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm/ But when i run rails s --debugger it will throw this strange…
Schovi
  • 1,960
  • 5
  • 19
  • 33
51
votes
15 answers

How to install ruby-debug when needing necessary libraries and/or headers

My Rails is 3.2.1.4, Ruby is 1.9.3p448. I got an error when I install ruby-debug: Building native extensions. This could take a while... ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. …
HXH
  • 1,643
  • 4
  • 19
  • 31
43
votes
6 answers

Ruby on Rails: debugging rake tasks

When I write debugger it does not start: NoMethodError: undefined method `run_init_script' for Debugger:Module from /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:239:in `debugger' from (irb):4 If I run rake my:task…
Andrey Kuznetsov
  • 11,640
  • 9
  • 47
  • 70
29
votes
3 answers

Is there any way to tell which gems and plugins are loaded at runtime for a Rails process?

Is there any command either in debugger or ruby-debug to get a list of all gems and/or plugins loaded in memory for a Rails process? I understand only the 'require' gems are loaded but I would like to quickly see what got loaded during runtime.
Chirag Patel
  • 5,819
  • 8
  • 35
  • 38
28
votes
7 answers

Start ruby debugger if rspec test fails

Often, when a test fails, I spend quite sometime trying to figure out the what caused it to fail. It'd be useful if RSpec could kick off a Ruby debugger when the test fails, so that I can inspect the local variables immediately to drill down on the…
Vighnesh
  • 708
  • 8
  • 25
20
votes
3 answers

Cannot use ruby-debug19 with 1.9.3-p0?

Possible Duplicate: Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found: _ruby_threadptr_data_type” I run this: gem install ruby-debug19 And in my cucumber env.rb file, I have this: require 'ruby-debug' When I try to…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
16
votes
2 answers

Ruby Debug "no such file to load --spec_helper"

Noob who may be missing something obvious ... I'm trying to debug an Rspec file. The Rspec file is stripped down at this point: require 'spec_helper' describe PagesController do render_views describe "GET 'home'" do describe…
Kevin
  • 744
  • 2
  • 7
  • 17
15
votes
5 answers

ruby_threadptr_data_type error

I'm starting up a new rails app with the latest version of rails (3.1.3). Rails crashes when I try to start up the server. First I fixed this bug, and now I'm getting this one ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol:…
declan
  • 5,605
  • 3
  • 39
  • 43
15
votes
9 answers

How to stop the Rails debugger for the current request

Say I have a loop in my code that calls the rails debugger a few times def show animals = ['dog', 'cat', 'owl', 'tiger'] for animal in animals debugger # do something else end Assuming I started my server with the --debugger option,…
Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175
15
votes
5 answers

ruby-debug won't install / build native extensions

I have searched high and low for a solution. I have both linecache19 and ruby_core_source installed. Neither of these commands will work: gem install ruby-debug19 gem install ruby-debug19 --…
Binary Logic
  • 2,562
  • 7
  • 31
  • 39
14
votes
2 answers

how do I install ruby-debug in ruby 1.9.3 / Rails 3.2.1

Possible Duplicate: Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found: _ruby_threadptr_data_type” I'm done with printing to the console -- I want to move up to the 20th century and start using a debugger!! But how…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
13
votes
1 answer

Jump to next line of *my code* in ruby-debug

In ruby-debug, the next command takes you to the next line of code to be executed, regardless of whether that line is in your own code, or in the rails framework, or in a gem. Is there some way to force ruby-debug (1.9) to jump to the next line that…
steven_noble
  • 4,133
  • 10
  • 44
  • 77
1
2 3
10 11