Search code examples
ruby-on-railsrubypik

Pik on Windows 7 doesn't remember the selection


I am using pik on Windows 7. I am unable to make pik to remember the ruby version selection.

Example:

Command Window 1

> pik list
* 187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
  193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

I select version 193.

>pik 193
>pik list
  187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
* 193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

Now I launch another command window:

Command Window 2

> pik list
* 187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
  193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

In the new window the ruby selection is not remembered. How do I make pik persist the ruby selection across command window sessions?


Solution

  • Pik is not loaded when you open a new command prompt. Because of that, it is unable to default to some Ruby interpreter for a new window.

    To have one particular Ruby interpreter in the PATH you will need to modify your user or system PATH so it is available always.

    Later you can use Pik to change the version of Ruby to the one you desire.

    However, you can setup a default Ruby so you can do pik default to use that one. See pik help use for documentation.