Running a Ruby installation off a CD (under Windows)

I’ve written some stuff I’d like to show to someone who doesn’t already have Ruby installed.

So, I plan to try copying an install of Ruby for Windows onto a CD-ROM. My stuff is purely console-based, so all I need is ruby.exe and the libraries (and relatively few of those, I guess).

I’m asuming I can create a batch file to set up the appropriate environment variables to allow ruby.exe to find the libraries (although, that will presumably require tweaking, to stick in the drive letter of their CD-ROM).

Before I start hacking at it, has anyone tried to do this before? If so, any advice?

Thanks in advance,

Harry O.

Hi,

I’m asuming I can create a batch file to set up the
appropriate environment variables to allow ruby.exe to find
the libraries (although, that will presumably require
tweaking, to stick in the drive letter of their CD-ROM).

You don’t have to do it. Since 1.6, ruby.exe sets $LOAD_PATH
according to its own path.

e.g.,

$(TOPDIR)/lib/ruby/site_ruby/$(VERSION)
$(TOPDIR)/lib/ruby/site_ruby/$(VERSION)/$(SITE_ARCH)
$(TOPDIR)/lib/ruby/site_ruby/
$(TOPDIR)/lib/ruby/$(VERSION)
$(TOPDIR)/lib/ruby/$(VERSION)/$(ARCH)
.

where VERSION is 1.6 or 1.8, ARCH is same to RUBY_PLATFORM,
SITE_ARCH is i386-msvcrt for 1.8 on mswin32 and mingw32, or
same to ARCH otherwise. TOPDIR is the ruby.exe’s directory
with the last “/bin” removed.

···

At Thu, 24 Jul 2003 18:39:35 +0900, Harry Ohlsen wrote:


Nobu Nakada

On Thu, 24 Jul 2003 18:39:35 +0900, Harry Ohlsen
harryo@qiqsolutions.com wrote (more or less):

I’ve written some stuff I’d like to show to someone who doesn’t already have Ruby installed.

So, I plan to try copying an install of Ruby for Windows onto a CD-ROM. My stuff is purely console-based, so all I need is ruby.exe and the libraries (and relatively few of those, I guess).

I’m asuming I can create a batch file to set up the appropriate environment variables to allow ruby.exe to find the libraries (although, that will presumably require tweaking, to stick in the drive letter of their CD-ROM).

Before I start hacking at it, has anyone tried to do this before? If so, any advice?

Thanks in advance,

How many problems there are depends on the version of Windows
targetted, and whether you yourself are using it tocreate the CD…

For a Win9x installation, I don’t see any problem.

You’ll need to know the drive letter of the CD-ROM drive that Ruby
will be run from.

And the RubyWin installer sets these environment variables as it
installs: (where D:\Programs\Coding\Ruby is my install directory)

REM Ruby Install – do not edit this line
set TCL_LIBRARY=D:\Programs\Coding\Ruby\tcl\lib\tcl8.3
set RUBY_TCL_DLL=D:\Programs\Coding\Ruby\tcl\bin\tcl83.dll
set RUBY_TK_DLL=D:\Programs\Coding\Ruby\tcl\bin\tk83.dll
set path=%path%;D:\Programs\Coding\Ruby\bin
REM Ruby Install – do not edit this line

For which you could write a wee DOS batch file which sets these, then
starts RubyWin.

Cheers,
Euan
Gawnsoft: http://www.gawnsoft.co.sr
Symbian/Epoc wiki: http://html.dnsalias.net:1122
Smalltalk links (harvested from comp.lang.smalltalk) http://html.dnsalias.net/gawnsoft/smalltalk

have Ruby installed ... [on] Windows. Before I start hacking at it, has
anyone tried to do this before?

Try RubyScript2Exe. It worked for me!

http://www.erikveen.dds.nl/rubyscript2exe/index.html

With kind regards!

···

Harry Ohlsen <harryo@qiqsolutions.com> Jul 24, 2003 at 06:39 PM wrote:

I've written some stuff I'd like to show to someone who doesn't already

That’s pretty much what I discovered. I did set the TCL environment variables, though. Maybe I don’t even need those, but I haven’t tried running anything that used TK yet, so I’m not sure.

Harry O.

···

nobu.nokada@softhome.net wrote:

You don’t have to do it. Since 1.6, ruby.exe sets $LOAD_PATH
according to its own path.

e.g.,

$(TOPDIR)/lib/ruby/site_ruby/$(VERSION)
$(TOPDIR)/lib/ruby/site_ruby/$(VERSION)/$(SITE_ARCH)
$(TOPDIR)/lib/ruby/site_ruby/
$(TOPDIR)/lib/ruby/$(VERSION)
$(TOPDIR)/lib/ruby/$(VERSION)/$(ARCH)
.

where VERSION is 1.6 or 1.8, ARCH is same to RUBY_PLATFORM,
SITE_ARCH is i386-msvcrt for 1.8 on mswin32 and mingw32, or
same to ARCH otherwise. TOPDIR is the ruby.exe’s directory
with the last “/bin” removed.

So, I plan to try copying an install of Ruby for Windows onto
a CD-ROM. My stuff is purely console-based, so all I need is
ruby.exe and the libraries (and relatively few of those, I
guess).

I'm asuming I can create a batch file to set up the
appropriate environment variables to allow ruby.exe to find
the libraries (although, that will presumably require
tweaking, to stick in the drive letter of their CD-ROM).

Before I start hacking at it, has anyone tried to do this
before? If so, any advice?

I think you're looking for AllInOneRuby [1]. It's made for
exactly these kind of situations...

gegroet,
Erik V.

[1] AllInOneRuby - A "Just-in-Time and Temporary Installation of Ruby"