# Updating the search paths dynamically in script

**URL:** <https://www.ruby-forum.com/t/updating-the-search-paths-dynamically-in-script/172964>\
**Category:** IronRuby\
**Created:** [July 30, 2009, 4:12pm UTC](https://www.ruby-forum.com/t/updating-the-search-paths-dynamically-in-script/172964 "2009-07-30T16:12:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [July 30, 2009, 4:12pm UTC](https://www.ruby-forum.com/t/updating-the-search-paths-dynamically-in-script/172964/1 "2009-07-30T16:12:57Z")

</div>

hi,

i’ve been including my libs using the RUBYLIB env variable, doing  
SET RUBYLIB=‘some path’

then running ir program.rb and it now has access to the files in ‘some  
path’

i also tried to do this dynamically in the ruby script using ‘system’.

i.e.

system ‘SET RUBYLIB=‘some path’’  
require ‘some.dll’ (where that file is in the path above’.

but it doesnt find the file. i assume ir is setting up the search paths  
when it starts up, is there anyway to achieve?

what i want is to be able to include a ruby file in my C# project, which  
can include all the dll’s in the projects bin easily. i guess i could  
just traverse the directory and do a require ‘file’ but the RUBYLIB path  
seems more flexible.

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [July 30, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/updating-the-search-paths-dynamically-in-script/172964/2 "2009-07-30T16:18:49Z")

</div>

ok, i managed to get this to work.

$: \<\< “some path”  
require ‘some.dll’

not sure if its recommended…
