Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
For DPK installations on Windows, this script will fix the RubyGems CA issue and add the Puppet-based RubyGems location to `PATH`
# Enable RubyGems
#
# The RubyGems included with the DPK can't download from RubyGems.org due to an oudated SSL Certificate
#
# invoke-webrequest https://gist.githubusercontent.com/iversond/e56e608cf8fa65f7160416f4c434da57/raw/5e8cc944ad8a4c261a7eff44cdf4413e4a826b12/enableRubyGems.ps1 -outfile $env:TEMP\enableRubyGems.ps1; . $env:TEMP\enableRubyGems.ps1
#
$puppetGemFolder = Resolve-Path 'C:\Program Files\Puppet Labs\Puppet\sys\ruby\lib\ruby\*\rubygems\ssl_certs\'
Invoke-WebRequest https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem -OutFile $puppetGemFolder\RubyGemsCA.pem
$env:PATH+=";C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, "Machine")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment