On Fri, May 13, 2011 at 11:37 PM, David Jacobs <developer / wit.io> wrote:
> Today's my last day at work, and my boss wants me to move a Ruby library I
> wrote to her Windows computer.
>
> I want to create an install script that moves my library into the Ruby bin
> directory. One problem: how do I find that directory programmatically? On
> Linux I'd shell out to `which`, but that doesn't appear to be an option in
> XP.
>
> Thoughts?

The RubyInstaller stores its install location in:
- "HKEY_CURRENT_USER\Software\RubyInstaller\MRI\1.9.2\InstallLocation"
when installed by a user.
- "HKEY_LOCAL_MACHINE\Software\RubyInstaller\MRI\1.9.2\InstallLocation"
when installed for all users by an Administrator.

Alternatively, you can check Ruby's ENV['PATH'] for the Ruby location.
That assumes that Ruby's location is added to the user's or computer's
path, however, which isn't a given.

-- 
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.