From: Phlip Date: 2005-11-07T23:17:12+09:00 Subject: Re: I can't get RUBYSCRIPT2EXE_LIB to work Alex Fenton wrote: > You should normally just need to create a runnable .rb that requires the > libraries in the normal way. Right. It's an application, not a library, so we have the equivalent of this structure: ../main.rb ../src/module.rb > If you want to be able to create a > rubyscript.exe from within your project tree (ie not loading your custom > library from ruby's standard library directories), just prefix 'lib' to > ruby's library load path before doing the requires. > > $:.unshift('lib') Ah - I didn't notice the system put them in there. So when I say... $:.unshift('src') require 'module.rb' ....Ruby inside the EXE still complains no such file to load -- src/module.rb. Why does Ruby insist on looking for src/module.rb when lib/module.rb is also an option? So I dyke out the second unshift: $:.unshift('src') if not defined?(RUBYSCRIPT2EXE) require 'module.rb' Now the program gets past the require, and I get all sorts of other errors, probably indicating the program can't see all the data files. I don't understand why this stuff worked a year ago, even if I had a flatter folder hierarchy. It found files in the current folder. Thanks for the tip. -- Phlip http://www.greencheese.org/ZeekLand <-- NOT a blog!!!