mercredi 18 mars 2015

New To Ruby, uninitialized constant error

I have these two Classes in RubyMine:


book.rb



class Book
def initialize(name,author)
end
end


test.rb



require 'book'
class teste
harry_potter = Book.new("Harry Potter", "JK")
end


When I run test.rb, I get this error: C:/Users/DESKTOP/RubymineProjects/learning/test.rb:3:in <class:Test>': uninitialized constant Test::Book (NameError) from C:/Users/DESKTOP/RubymineProjects/learning/test.rb:1:in' from -e:1:in load' from -e:1:in'


Aucun commentaire:

Enregistrer un commentaire