Currently, I have to work on a Windows (specifically, Windows 10) system for two Ruby on Rails projects with different version. Also, the said system is fresh and there wasn't any existing rails installed yet.

Previous Encounter

Previously, I use InstantRails for Windows installment but, correct me if I am wrong, this method is long gone supported and isn't used anymore.

So what I'm after right now is to use something similar to RVM (rbenv) which is easy to install on Windows and here is where PIK comes in.

Pik Installer

Current Specifications and Requirements

As mentioned, operating system is Windows 10 (64-bit).

For my RoR, what I'll be needing are versions Rails 3.2 and 4.2.

Both uses MySQL 5.5.x. Though I won't be discussing as to how to set this up. I usually just use a WAMP for this matter.

Installation Steps

  1. Download first at least one of the Ruby interpreter environment in RubyInstallers.org. Usually I pick both the version I need which is this writing is 1.9.3 (for Rails 3.2) and 2.2.3 (for Rails 4.2)

    Steps on installing should be pretty straightforward with its installation wizard.

  2. Next is to download Pik from github. As of this writing, the latest version is Pik-0.3.0.

    NOTE: Pik, as of 2012, is no longer maintained but as of my test this should still work and so far the easiest, from what I have tried, to install.

  3. [OPTIONAL] Add on the PATH environments the installation folder of Pik so you can easily use pik command without going through the folder location. The usual process goes as follows:

    1. Open This PC, Right-click and select Properties
    2. Select the Advanced System Settings (on the left side)
    3. Click the Environment Variables button
    4. Under System Variables, select Path, then click Edit.

  4. After installing, next should be adding the bin folders by adding

    >pik add [BIN FOLDER OF RUBY]

    where the bin folder shold be similar to this: C:\Ruby[version]\bin

  5. To verify if the ruby versions are installed, you can simply type:

    >pik list

  6. To change version, type:

    >pik default
    >pik use [RUBY VERSION]

  7. That's it! Use ruby -v to check the version.

Running Multiple Version of Ruby on Windows with Pik

Final notes

Again as of this writing, Pik is no longer maintained by its author but from what I have tried, this one is the easiest to follow and install. If there is a newer method or easier process to do this, just put it in the comments below and I'll try it.



No comments :

Post a Comment