Last active
April 5, 2018 17:48
-
-
Save ferventcoder/947479688d930e28d632 to your computer and use it in GitHub Desktop.
Full Ruby Stack Install using Chocolatey and PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches | |
# Powershell specific argument passing | |
# You must be on the latest beta of chocolatey for this to work properly (redownload files) | |
choco upgrade chocolatey -pre | |
$originalPath = $env:PATH | |
choco install ruby --version 1.9.3.55100 -my --install-arguments '/verysilent /dir=""c:\tools\ruby193"" /tasks=""assocfiles""' --override-arguments | |
# DevKit for Ruby 1.x | |
$env:PATH=$originalPath | |
$env:PATH +=';c:\tools\ruby193\bin' | |
choco install ruby.devkit | |
#TODO - get the certificate for rubygems installed | |
$env:PATH=$originalPath | |
choco install ruby --version 2.0.0.64800 -my -x86 --install-arguments '/verysilent /dir=""c:\tools\ruby200"" /tasks=""assocfiles""' --override-arguments | |
choco install ruby --version 2.0.0.64800 -fmy --install-arguments '/verysilent /dir=""c:\tools\ruby200-x64"" /tasks=""assocfiles""' --override-arguments | |
choco install ruby --version 2.1.8 -my -x86 --install-arguments '/verysilent /dir=""c:\tools\ruby21"" /tasks=""assocfiles""' --override-arguments | |
choco install ruby --version 2.1.8 -fmy --install-arguments '/verysilent /dir=""c:\tools\ruby21-x64"" /tasks=""assocfiles,modpath""' --override-arguments | |
choco install ruby --version 2.2.4 -my -x86 --install-arguments '/verysilent /dir=""c:\tools\ruby22"" /tasks=""assocfiles""' --override-arguments | |
choco install ruby --version 2.2.4 -fmy --install-arguments '/verysilent /dir=""c:\tools\ruby22-x64"" /tasks=""assocfiles""' --override-arguments | |
Write-Output "Attempting Good DevKit2 Installations" | |
# DevKit for Ruby 2.x x64 | |
$env:PATH=$originalPath | |
#$env:PATH +=';c:\tools\ruby200-x64\bin;c:\tools\ruby21-x64\bin;c:\tools\ruby22-x64\bin' | |
choco install ruby2.devkit | |
move-item c:\tools\DevKit2 C:\tools\DevKit2-x64 -Force -EA Continue | |
#$env:PATH=$originalPath | |
# DevKit for Ruby 2.x x86 | |
#$env:PATH=$originalPath | |
#$env:PATH +=';c:\tools\ruby200\bin;c:\tools\ruby21\bin;c:\tools\ruby22\bin' | |
choco install ruby2.devkit -x86 -f | |
$env:PATH=$originalPath | |
Write-Output "Fixing DevKit Installations" | |
$env:PATH +=';c:\tools\ruby21\bin;' | |
@" | |
--- | |
- c:/tools/ruby193 | |
"@ | Out-File c:\tools\DevKit\config.yml -Force -Encoding UTF8 | |
pushd c:\tools\DevKit | |
ruby dk.rb install -f | |
popd | |
@" | |
--- | |
- c:/tools/ruby200 | |
- c:/tools/ruby21 | |
- c:/tools/ruby22 | |
"@ | Out-File c:\tools\DevKit2\config.yml -Force -Encoding UTF8 | |
pushd c:\tools\DevKit2 | |
ruby dk.rb install -f | |
popd | |
@" | |
--- | |
- c:/tools/ruby200-x64 | |
- c:/tools/ruby21-x64 | |
- c:/tools/ruby22-x64 | |
"@ | Out-File c:\tools\DevKit2-x64\config.yml -Force -Encoding UTF8 | |
pushd c:\tools\DevKit2-x64 | |
ruby dk.rb install -f | |
popd | |
choco install pik | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby193\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby200\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby200-x64\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby21\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby21-x64\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby22\bin | |
cmd /c C:\tools\pik\pik.bat add c:\tools\ruby22-x64\bin |
This is a bit outdated and needs to be updated for newer rubies.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what 1.9.3 needs - https://github.com/ferventcoder/vagrant-windows-puppet/blob/093a002abe50e958ca72fca0fd59debb83ccf630/boxes/shared/shell/LocalDevPrep.ps1#L13-L17