sid smith
sid smith

Reputation: 533

Error when using debugger - `require': no such file to load -- ruby-debug (LoadError)'

I created a breakpoint in the code below. When I run it in windows cmd using ruby test.rb, I get the error inrequire': no such file to load -- ruby-debug (LoadError)` Why does this error happen and how do I fix it ?

class Dog
    def initialize(name)
        @name = name
    end

    def bark
        puts "bow"
        puts "wow"
        puts "wow"
    end
end

require 'ruby-debug'
debugger

d1 = Dog.new("d1")
d2 = Dog.new("d2")

puts "d1 says: " 
d1.bark
puts
puts "d2 says: " 
d2.bark

Someone had also installed ruby 1.8 on my computer before. So I am not sure if this could be responsible. When i invoke gem install debugger from the test.rb folder, I get the error:

Building native extensions. This could take a while... ERROR: Error installing debugger: ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb extconf.rb failed Could not create
Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Upvotes: 1

Views: 705

Answers (1)

daremkd
daremkd

Reputation: 8424

Have you installed the? Ruby Devkit ? The instructions for installing it are here .

Upvotes: 1

Related Questions