Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby-debug19: Can't get working with Ruby 1.9.1p376

Tags:

ruby

debugging

I'm trying to use ruby-debug19 with Ruby 1.9.1p376 but am getting the following error:

test.rb:2:in `require': no such file to load -- ruby-debug19 (LoadError) from test.rb:2:in `<main>'

Here's test.rb:

require 'rubygems'
require 'ruby-debug19'

Here's the output of "gem list":

*** LOCAL GEMS ***
ruby-debug19 (0.11.6)
(etc.)

So running "ruby test.rb" generates the above error.

Am I doing this wrong? I thought this was the correct way to run ruby-debug19 (by including the gem and adding "debugger" statements) and haven't been able to find any articles/posts with the same problem.

I am using RVM but the above output is all under the same version of Ruby ("ruby -v" shows 1.9.1p376 as expected, and the gem list output is specific to that version and not the OS X system-installed version 1.8.7).

like image 217
TK-421 Avatar asked Apr 11 '10 20:04

TK-421


2 Answers

Try just

require 'ruby-debug'

(Despite the gem's name)

Also you don't need require 'rubygems' anymore when using Ruby 1.9.

like image 146
rnicholson Avatar answered Oct 22 '22 02:10

rnicholson


For ruby 1.9.3 and Rails 3.2 with pow:

In your Gemfile:

group :development do
  gem 'debugger'
end

And at the bottom of config/environments/development.rb:

require 'debugger'
Debugger.start_remote
Debugger.settings[:autoeval] = true

Then connect to the debugger in your terminal using:

rdebug -c
like image 27
markquezada Avatar answered Oct 22 '22 02:10

markquezada