effortless icon indicating copy to clipboard operation
effortless copied to clipboard

rubygems_url Broken on Windows

Open BrysonR opened this issue 3 years ago • 1 comments

Description

chef/scaffolding-chef-infra, on Windows only, sets the value of rubygems_url to a non-existent variable.

The linux scaffolding properly sets it here

The windows scaffolding sets it here which I believe should be the same as the linux version and rubygems_url "${cfg_rubygems_url}"

The outcome is that the rubygems url is never set or defaulted and produces the following output.

Scaffolding Version

chef/scaffolding-chef-infra v0.23.0

Platform Version

Windows Server 2012R2

Build or Run Output

FATAL: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '4'
---- Begin output of ["bundle", "install"] ----
STDOUT: 
STDERR: [!] There was an error parsing `Gemfile`: The source must be an absolute URI. For example:
source 'https://rubygems.org'. Bundler cannot continue.
---- End output of ["bundle", "install"] ----
Ran ["bundle", "install"] returned 4

BrysonR avatar Jul 22 '21 20:07 BrysonR

This just bit me, in chef/scaffolding-chef-infra/0.25.0/20220518131557 We set a custom gems URL (onprem artifactory). Worked around it by hacking the output file (client-config.rb) during studio install phase.

function Invoke-Install {
  Invoke-DefaultInstall
  # fix bug in chef/scaffolding-chef-infra
  (Get-Content ${pkg_prefix}/config/client-config.rb) | Foreach-Object {$_ -replace 'rubygems_url "#{rubygems_url}"','rubygems_url "#{cfg_rubygems_url}"'}  | Out-File ${pkg_prefix}/config/client-config.rb
}

mrysanek avatar Dec 09 '22 20:12 mrysanek