Can't access class of a loaded file in the IRB

I have two Ruby files. I am able to access the class of one of the files
but not the other. Here are my two files:

bankaccount.rb:

http://www.techotopia.com/index.php/Ruby_Object_Oriented_Programming

class BankAccount
def initialize ()
end

def test_method
puts “The class is working”
end
end

complex.rb:

class ComplexNumber
def initialize()
end
def a
@a = 0
end
def b
@b = 0
end
end

I can create a BankAccount object just fine in the IRB, but when I try
to create a ComplexNumber object I get an error saying “unitialized
constant” even though I entered ‘load “complex.rb”’ and ‘load
“bankaccount.rb”’.

irb(main):008:0> a = BankAccount.new()
=> #BankAccount:0x2b0fc50
irb(main):009:0> b = ComplexNumber.new()
NameError: uninitialized constant ComplexNumber
from (irb):9
from C:/Ruby193/bin/irb:12:in `’

2012/7/6 One T. [email protected]:

I can create a BankAccount object just fine in the IRB, but when I try
to create a ComplexNumber object I get an error saying “unitialized
constant” even though I entered ‘load “complex.rb”’ and ‘load
“bankaccount.rb”’.

File name “complex.rb” is used by one of Ruby’s library files, and
it’s that file that gets loaded. Rename your file or explicitly mark
that you mean the file in current directory: ‘load “./complex.rb”’.

– Matma R.