From: Daniel Carrera Date: 2003-08-19T03:53:48+09:00 Subject: Re: Distributing a application > I'm thinking about distributing a application (a game, to be more > specific) written in Ruby using the GTK+ library and ruby-gtk. Is > there a way that I could distribute my application without having to > distribute Ruby along? Or there's any other option I do not know about? > > My application is meant to be used in any OS, so any hints for any OS > would be helpful. > > Thank you in advance, > > Andr� I've been thinking a lot about this myself. This is the best I've come up with so far for Unix/Linux/Mac OS X: * Distribute a copy of ruby and all necessary libraries with your program. $ cp your_app.rb your_app/ $ cp /usr/bin/ruby your_app/bin $ cp -r /usr/lib/ruby your_app/lib/ruby * Include a shell script that will setup the appropriate environment and call your program: $ cat >>your_app.sh #!/bin/sh export RUBYLIB="/opt/your_app/lib" ./ruby your_app.rb $ $ chmod 755 your_app.sh $ cp your_app.sh your_app/ To install the program, just 'cp your_app/ /opt/'. If the user runs /opt/your_app/your_app.sh, your program gets run. * You might want to make a GUI installer. In that case: $ cp setup.rb your_app/ $ cat >>setup.sh #!/bin/sh export RUBYLIB="./lib" ./ruby setup.rb $ $ chmod 755 setup.sh $ cp setup.sh your_app/ * To make the final distribution, make a zip or tar.gz file and get the user to unzip the file and run setup.sh * You might want to use 'Makeself' to creat a self-extracting archive which will run your setup.sh file after it's been extracted. http://www.megastep.org/makeself/ Hope that helps, -- Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88 .-"~~~"-. On the menu of a Swiss restaurant: / O O \ "Our wines leave you nothing to hope for" : s : \ \___/ / Sign outside a Hong Kong tailor shop: `-.___.-' "Ladies may have a fit upstairs"