Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Last active September 6, 2015 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferventcoder/43353629de4739bd10fc to your computer and use it in GitHub Desktop.
Save ferventcoder/43353629de4739bd10fc to your computer and use it in GitHub Desktop.
Installing the Rubies
# This script is geared towards cmd.exe.
# If you are using powershell, look for the hints
# about alternative commands in comments
# Note there is no alternative for refreshenv
# Pik also may not work in PowerShell at all.
# It certainly doesn't to update paths
SET ORIG_PATH=%PATH%
#$ORIG_PATH=$env:PATH
choco install ruby -my -version 1.9.3.55100 -o -ia '"/verysilent /dir=C:\ruby193 /SP- /NOICONS"'
choco pin -n ruby --version 1.9.3.55100
SET PATH=%PATH%;C:\ruby193
#$env:PATH +=";C:\ruby193"
choco install ruby.devkit -y
SET PATH=%ORIG_PATH%
#$env:PATH=$ORIG_PATH
# install 64-bit rubies
choco install ruby -my -version 2.0.0.64500 -o -ia '"/verysilent /dir=C:\ruby200-x64 /SP- /NOICONS"'
choco pin -n ruby --version 2.0.0.64500
# this one is cmd.exe sensitive:
choco install ruby -my -version 2.1.6 -o -ia "/verysilent /dir=C:\ruby21-x64 /tasks=""assocfiles,modpath"""
#choco install ruby -my -version 2.1.6 -o -ia '/verysilent /dir=C:\ruby21-x64 /tasks=""assocfiles,modpath""'
SET PATH=%PATH%;C:\ruby200-x64;C:\ruby21-x64
#$env:PATH +=";C:\ruby200-x64;C:\ruby21-x64"
choco install ruby2.devkit -y
ren C:\tools\DevKit2 DevKit2-x64
cd C:\tools\DevKit2-x64
C:\ruby21-x64\bin\ruby dk.rb install --force
SET PATH=%ORIG_PATH%
#$env:PATH=$ORIG_PATH
choco install ruby -mfy -x86 -version 2.1.6 -o -ia '"/verysilent /dir=C:\ruby21 /SP- /NOICONS"'
choco pin -n ruby --version 2.1.6
# install any other x86 versions of ruby now
SET PATH=%PATH%;C:\ruby21
#$env:PATH +=";C:\ruby21"
choco install ruby2.devkit -x86 -fy
# manual check time
# ensure that this devkit only targets the 64bit rubies
# by checking the config.yml in c:\tools\DevKit2
# BE AWARE that Pik may not work at all from powershell
choco install pik -y
SET PATH=%PATH%;C:\tools\pik
#$env:PATH +=";C:\tools\pik"
pik add C:\ruby193\bin 193
pik add C:\ruby200-x64\bin 200-x64
pik add C:\ruby21\bin 21
pik add C:\ruby21-x64\bin 21-x64
#Now close your shell and reopen
## AFTER INSTALL Changes / Checks
# THE ACTUAL PATH - Open the GUI and go to it in Conrol Panel -> System
# PATH at the end of this after you close and reopen a shell should have
# - C:\tools\DevKit
# - C:\tools\DevKit2
# - C:\tools\DevKit2-x64 - This one will need to be added manually
# - C:\tools\pik - This one will need to be added manually
# - C:\ruby21-x64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment