Updating the search paths dynamically in script

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.

ok, i managed to get this to work.

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

not sure if its recommended…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs