You could do that using Command Processor AutoRun registry keys,
however, I advice against it since it could interfere with gem
installation or child process spawning:
https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun
The other approach is that you add that version of Ruby to the
system/user path and also manage it through Pik.
So when you start a new cmd.exe, that version is available in the path
and when you do pik x.y.z it changes.
> I'm trying to setup a base image for some virtual machines that would
> be cloned and used by multiple people, so I don't want the ruby
> versions installed under my user directory, but rather someplace more
> accessible to any user of the resulting vm's. I'm starting with the
> XP systems first and am an administrator on the system (win7 will come
> next, but it's easier to develop my process on XP )
>
> I created a directory c:\RubyVersions as a base location for Pik to
> install into, but when I try to set this I get an error. It looks
> like this
>
> C:\>md RubyInstalls
>
> C:\>pik config installs C:\RubyInstalls
>
> There was an error.
> Error: can't dup NilClass
>
> in: pathname.rb:205:in `dup'
> in: pathname.rb:205:in `initialize'
> in: pik/commands/config_command.rb:28:in `new'
> in: pik/commands/config_command.rb:28:in `execute'
> in: pik_runner:33
>
> Any idea where I'm going wrong here?
>
Problem is that is failing to read a configuration file.
Since you mention is Windows XP, "Document and Settings" folder might
be causing the issue, see other threads in this group for hints.
I recommend setting PIK_HOME environment variable to your desired directory.
Cheers,
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
Are you using pik 0.3.0 version? You can download from GitHub:
Have you tried setting also HOME to where you told Pik is PIK_HOME?
Have you tried *not* using Pik to download the binaries but instead
download them manually and extract them in the correct directory so
later you can "pik add C:\path\to\ruby\bin" ?