From: Phillip Gawlowski Date: 2010-01-27T00:48:29+09:00 Subject: Re: Installing Ruby Application On 26.01.2010 16:19, Tony Meier wrote: > What's the best way to install a Ruby (non-rails) application? > > So far I've built and written a launchable gem on my Mac. There's a > script, /lib/appname.rb that does everything. When I install the gem > (which works like a charm) on a WIN machine, the user has to open a cmd > window and launch C:\Ruby\lib\ruby\gems\1.8\gems\appname\lib\appname.rb > plus arguments, which I think is pretty ugly. > > I'm clueless on how I can make this a bit more userfriendly. http://www.erikveen.dds.nl/rubyscript2exe/ This could help. Alternatively: Both the OneClickInstaller and the new RubyInstaller.org register both the .rb and .rbw extensions with ruby.exe and rubyw.exe, respectively. Calling just the script launches Ruby. In the first case, with command line, in the second case without command line. So, just create an installer that packages your application, writes files to the necessary locations, creates Start Menu entries, and creates an uninstaller. We Windows user expect all that. Registry keys to look for: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\RubyFile\shell\open # CLI Ruby HKEY_LOCAL_MACHINE\SOFTWARE\Classes\RubyWFile\shell\open # "headless" Ruby You can also take a look at the InnoSetup files of the RubyInstaller project: http://github.com/oneclick/rubyinstaller/blob/master/resources/installer/rubyinstaller.iss Alas, Ruby doesn't create its own Registry hive, so you cannot check for the Ruby version with any ease (I'll file a feature request for that). NSIS is an OSS installer package: http://en.wikipedia.org/wiki/Nullsoft_Scriptable_Install_System Alas, you'll have to compile it yourself on MacOS X, but maybe somebody else already did that for you. :) If you don't want to rely on a particular Ruby version, but rather provide your own, just include one in your install package. Keep in mind, you'll have to keep track of dependencies yourself, since you cannot use RubyGems' dependency tracking. -- Phillip Gawlowski