Local ruby gems fail to install on Windows 2008R2: Errno::EADDRNOTAVAIL

I’m having trouble installing gems with the embedded ruby that comes with Chef Client v12.2.1, using the chef_gem resource:

  Mixlib::ShellOut::ShellCommandFailed
  ------------------------------------
  chef_gem[zabbixapi] (generic_server_win::libzabbix-deps line 6) had an error: Mixlib::ShellOut::ShellCommand Failed: Expected process to exit with [0], but received '1'
  ---- Begin output of C:/opscode/chef/embedded/bin/gem install c:/chef/cache/zabbixapi-2.2.2.gem -q --no-rdoc --no-ri -v "2.2.2" ----
  STDOUT:
  STDERR: ERROR:  While executing gem ... (Errno::EADDRNOTAVAIL)
      The requested address is not valid in its context. - connect(2)
  ---- End output of C:/opscode/chef/embedded/bin/gem install c:/chef/cache/zabbixapi-2.2.2.gem -q --no-rdoc --no-ri -v "2.2.2" ----
  Ran C:/opscode/chef/embedded/bin/gem install c:/chef/cache/zabbixapi-2.2.2.gem -q --no-rdoc --no-ri -v "2.2.2" returned 1

Also:

  • Same result when running the command manually on the command-line as an Administrator with the –local option
  • Same error occurs for other gems.
  • The servers that I’m trying to run this on have no internet access
  • I’m unable to reproduce the problem on a newly installed test machine (with internet access)
  • The version of ruby used is 2.0.0: ruby 2.0.0p451 (2014-02-24) [i386-mingw32]

Here is my Chef recipe:

cookbook_file "#{Chef::Config[:file_cache_path]}/zabbixapi-2.2.2.gem" do
  source 'zabbixapi-2.2.2.gem'
end

chef_gem "zabbixapi" do
  source "#{Chef::Config[:file_cache_path]}/zabbixapi-2.2.2.gem"
end


Source: ruby

Leave a Reply