From: Alex Fenton Date: 2005-11-07T14:32:11+09:00 Subject: Re: I can't get RUBYSCRIPT2EXE_LIB to work Phlip wrote: > Erik et al: > > I need to package MiniRubyWiki. When I run it, with a healthy chain > of 'require's into its modules, rubyscript2exe can't read them. You should normally just need to create a runnable .rb that requires the libraries in the normal way. 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') when rs2exe runs, it should notice these requires of your custom library files and bundle them in the package. > I need to add many more .rb files, so pages can load them > dynamically, so I add everything to a big list like The circumstances you should need to use RUBYSCRIPT2EXE_LIB are usually only when the - libraries, such as adapters for specific databases, are loaded dynamically after program startup, eg with autoload, such as when a connection is made - files are required conditionally during program execution if today.is_monday? require 'medication/prozac' else require 'medication/paracetamol' end - you want to bundle files that aren't ruby scripts into the lib tree. I use this to bundle .xpm icons into the library tree; this isn't necessarily the best way of bundling auxiliary files though. > Any ideas? I put RUBYSCRIPT2EXE_LIB into the lead file, miniWiki.rb, > above the first require... When you run rubyscript2exe.rb it should list what it's bundled - what output do you get? Eric helped me with some of these probs for my project Weft; you might find some ideas in there runnable ruby script, ready to be packaged using rubyscript2exe.rb - does the requires, exits if an exe is being made http://rubyforge.org/cgi-bin/viewcvs.cgi/weft-qda/weft-qda.rb?rev=1.2&cvsroot=weft-qda&content-type=text/vnd.viewcvs-markup rubyscriptfiles.rb - used when converting into a .exe http://rubyforge.org/cgi-bin/viewcvs.cgi/weft-qda/rubyscriptfiles.rb?rev=1.2&cvsroot=weft-qda&content-type=text/vnd.viewcvs-markup Rakefile - automates creation of exe - see the :executable target http://rubyforge.org/cgi-bin/viewcvs.cgi/weft-qda/Rakefile?rev=1.6&cvsroot=weft-qda&content-type=text/vnd.viewcvs-markup a