jeudi 11 août 2016

How to access a ruby file from another directory

I am having two Folder name Folder1 and Folder2.

In Folder1 I am having ruby File File1.rb and in Folder2 I am having File2.rb. I want to use method inside File1.rb to File2.rb.

When I try using require_relative 'File1.rb' in File2.rb it says it cannot able to access the file. What code I need to use to access File1.rb?

Note: If both files are in same folder, require_relative is working fine. But on different folder it is not working.

Aucun commentaire:

Enregistrer un commentaire