'require' is not loading files

I am new to ruby and have been teaching it to myself for the past so I
am still very new to Ruby. I have been trying to load external
source-code files into my program but for some reason every time I try
use require to load a file it does not work and I get this message

LoadError: cannot load such file – b
from
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
require' from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire’
from (irb):3
from /usr/local/bin/irb:12:in `’
irb(main):004:0> require

For example I create a file named a.rb and then in another program I try
to load it with require ‘a’ but I always get this message. When I use
load ‘a.rb’ it loads the file with no problem but I can not figure out
why require ‘’ will not load the files into the program. Like I said I
am very new to Ruby so any help is appreciated.

Subject: ‘require’ is not loading files
Date: lun 03 giu 13 01:25:10 +0900
Sorry for the delay!

Quoting Elliot M. ([email protected]):

I am new to ruby and have been teaching it to myself for the past so I
am still very new to Ruby. I have been trying to load external
source-code files into my program but for some reason every time I try
use require to load a file it does not work and I get this message

LoadError: cannot load such file – b

Recent Ruby does not include the current directory when looking for
scripts to load. Either use

require ‘./b’

or, maybe more expressive, use

require_relative ‘b’

You can also opt to include ‘.’ in the RUBYLIB global variable.

Carlo

require ‘./b’

or

require_relative ‘b’

2013/6/3 Elliot M. [email protected]

Am 03.06.2013 07:32, schrieb Carlo E. Prelz:

require ‘./b’

or, maybe more expressive, use

require_relative ‘b’

Note that require_relative will not work with irb.

Thank you for the help. require ‘./a’ works just like it should.