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 `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'