I am trying to run Test-Kitchen on a Windows 7 box, using Powershell, behind a corporate firewall (I'm following the tutorial at http://kitchen.ci/docs/getting-started/creating-cookbook). When I run:
PS C:\Users\jazzyb\Documents\git-cookbook> kitchen init --driver=kitchen-vagrant
I get
identical .kitchen.yml
identical chefignore
ERROR: Could not find a valid gem 'kitchen-vagrant' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: No connection could be made because
the target machine actively refused it. - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8
.gz)
PS C:\Users\jazzyb\Documents\git-cookbook>
Despite the fact I can access that file using Invoke-WebRequest
PS C:\Users\jazzyb\Documents\git-cookbook> Invoke-WebRequest https://api.rubygems.org/specs.4.8.gz
StatusCode : 200
StatusDescription : OK
Content : {31, 139, 8, 0...}
RawContent : HTTP/1.1 200 OK
x-amz-id-2: aVuWL3xWz9vwwto0GZE0uAJ4q8o8N+QsIC9QUJmO63mVNxY95pv994RHuQFrdaCCtvADJSaOOfo=
x-amz-request-id: CC71B064EACA4126
x-amz-version-id: 4Q20EeykLoACN7Ko3b9Bqw1cARiGEbaI
x-amz...
Headers : {[x-amz-id-2, aVuWL3xWz9vwwto0GZE0uAJ4q8o8N+QsIC9QUJmO63mVNxY95pv994RHuQFrdaCCtvADJSaOOfo=],
[x-amz-request-id, CC71B064EACA4126], [x-amz-version-id, 4Q20EeykLoACN7Ko3b9Bqw1cARiGEbaI],
[x-amz-meta-surrogate-key, full-index]...}
RawContentLength : 2626893
Setting the proxy directly doesn't seem to work either
PS C:\Users\jazzyb\Documents\git-cookbook> kitchen init --driver=kitchen-vagrant --http_proxy=http://proxy.somecorp.com:80/
Am I missing something obvious?
Export the http_proxy
, HTTP_PROXY
, https_proxy
, and HTTPS_PROXY
environment variables. Rubygems doesn't directly supports Windows' proxy configuration system, you need to do it the Unix way.