Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Component/s: windows
-
Labels:None
Description
[Thu, 03 Nov 2011 17:34:43 -0700] FATAL: NoMethodError: windows_zipfile[C:\SomeDir]
(cookbook::recipe /var/chef/cache/cookbooks/cookbook/recipes/reciper.rb) had an error: undefined method `pid' for 2324:Fixnum
I was able to get ruby 1.8 to work by commenting out all lines in windows\libraries\ruby_19_patches.rb
If in fact this fixes an issue that only exists in ruby 1.9, shouldn't this be wrapped in a if RUBY_VERSION block?
Issue Links
- relates to
-
COOK-1033
Windows cookbook borks on Unix systems because of the Ruby 1.9 patches
-
Short answer
I think we can just remove the call to 'pid' in the block.call:
https://github.com/opscode/cookbooks/blob/master/windows/libraries/ruby_19_patches.rb#L16
Please try this and see if it fixes the problem.
Long answer
The patch file name may be misnamed. Basically this is fixing a bug in Chef 0.10.4's shelling out/forking logic:
Chef 0.10.4 currently has two ways to 'shell out': Chef::Mixin::Command::Windows and Chef::ShellOut::Windows. Both were using different approaches to do the actual underlying command execution Open3.popen3 and Open4.popen4.
The win32-open3 gem (which is loaded on Ruby 1.8 only) provides implementations of both Open3 and Open4. Ruby 1.9 has no implementation of Open3, so Chef::Mixin::Command::Windows was completely borked on Ruby 1.9 systems. Long term this needed to be patched in Chef (which it was), but I wanted to ensure users of the new Ruby 1.9 based full-stack MSI wouldn't be out in the dark with the current Chef 0.10.4 release. The ruby_19_patches.rb file represents a back-porting of this patch.
We have a few things in flight that will make all of this a non-issue:
https://github.com/opscode/chef/blob/master/chef/lib/chef/shell_out/windows.rb
Hope this long explanation helps!