Uncaught exception: cannot load such file --

There is an empty file called include_test.rb and a file test.rb which
includes include_test.rb
i.e. the content of test.rb:
require ‘include_test.rb’

if I run:
ruby test.rb it gives following error:

Uncaught exception: cannot load such file – include_test

Subject: Uncaught exception: cannot load such file –
Date: Mon 17 Dec 12 08:10:01PM +0900

Quoting Prog R. ([email protected]):

if I run:
ruby test.rb it gives following error:

Uncaught exception: cannot load such file – include_test

Try

require ‘./include_test.rb’

or

require_relative ‘include_test.rb’

Carlo

Carlo E. Prelz wrote in post #1089363:

Subject: Uncaught exception: cannot load such file –
Date: Mon 17 Dec 12 08:10:01PM +0900

Quoting Prog R. ([email protected]):

if I run:
ruby test.rb it gives following error:

Uncaught exception: cannot load such file – include_test

Try

require ‘./include_test.rb’
is working.
or

require_relative ‘include_test.rb’
gives error: LoadError: cannot infer basepath

Carlo
Is it so that require ‘file_name’ doesnt work with ruby 1.9.3 but works
for 1.8.7?

Subject: Re: Uncaught exception: cannot load such file –
Date: Mon 17 Dec 12 09:07:26PM +0900

Quoting Prog R. ([email protected]):

Is it so that require ‘file_name’ doesnt work with ruby 1.9.3 but works
for 1.8.7?

Ruby looks for include files that do not explicitly specify a path in
a series of paths. Some are hardcoded. To them you can add other paths
by including them in global variable “RUBYLIB”.

From what I remember, ruby 1.8 included the current directory in the
hardcoded paths. This is not true anymore with 1.9. But if you specify
(in Linux)

export RUBYLIB=’.’

then you will not need to specify the ‘./’ before your include file.

Carlo

Prog R. wrote in post #1089367:

Carlo E. Prelz wrote in post #1089363:

Subject: Uncaught exception: cannot load such file –
Date: Mon 17 Dec 12 08:10:01PM +0900

Quoting Prog R. ([email protected]):

Uncaught exception: cannot load such file – include_test

Try

require ‘./include_test.rb’
is working.
or

require_relative ‘include_test.rb’
gives error: LoadError: cannot infer basepath

Carlo
Is it so that require ‘file_name’ doesnt work with ruby 1.9.3 but works
for 1.8.7?
I dont think that is the case as it is working fine on ubuntu, but not
on windows.