views:

184

answers:

1

Hey,

I'm using Eclipse with RDT to do some Ruby programming. I'm trying to include a file in another, but require fails. Both files are in the same directory.

The folder hierarchy is set up like this:

Project > src > folder > a.rb b.rb

If I try to require b.rb in a.rb I would use this:

require 'b.rb'

But I get the following error message:

src/folder/a.rb:1:in `require': no such file to load -- b.rb (LoadError) from src/folder/a.rb:1

If, however, I specify the full path it works:

require '/home/peter/workspace/project/src/folder/b.rb'

But, obviously, using the full path is a bit stupid.

How can I fix this?

A: 

Like evoked here, if the ruby editor uses a ProcessBuilder to call ruby, the working directory is whatever it was when the JVM was started.

A good test would be start eclipse from the "Project > src > folder" directory to see if the relative path is seen then.

VonC