# Change path for require

**URL:** <https://www.ruby-forum.com/t/change-path-for-require/108006>\
**Category:** Ruby\
**Created:** [June 28, 2007, 10:46am UTC](https://www.ruby-forum.com/t/change-path-for-require/108006 "2007-06-28T10:46:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [June 28, 2007, 10:46am UTC](https://www.ruby-forum.com/t/change-path-for-require/108006/1 "2007-06-28T10:46:09Z")

</div>

how can i change the path for require?  
for example my script is in C:\test and a have require ‘watir’ and i  
want to add another require to a file wich is in  
C:\test\tst\requiered\_file.rb

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [June 28, 2007, 10:55am UTC](https://www.ruby-forum.com/t/change-path-for-require/108006/2 "2007-06-28T10:55:52Z")

</div>

Le 28 juin à 10:46, mihai a écrit :

> how can i change the path for require?  
> for example my script is in C:\test and a have require ‘watir’ and i  
> want to add another require to a file wich is in  
> C:\test\tst\requiered\_file.rb

Either :

require “tst/requiered\_file.rb”

Or :

$LOAD\_PATH \<\< “c:/test/tst”  
require “requiered\_file.rb”

(Or any variations to find the path, but it’s somewhat trickier with  
relatives paths if you call your script from another directory.)

Fred
