Home Ask Login Register

Developers Planet

Your answer is one click away!

Johnny5 February 2016

chef windows cookbook compile error, cannot find file windows/error

On a chef-client run, I'm seeing this windows cookbook compile error, as show below. What is it trying to require in that it can't find, and how to fix? Is 'windows/error' a ruby gem or something else?

Recipe Compile Error in c:/chef/cache/cookbooks/windows/libraries/windows_privileged.rb

cannot load such file -- windows/error

Cookbook Trace:
  c:/chef/cache/cookbooks/windows/libraries/windows_privileged.rb:24:in `<top (required)>'

Relevant File Content:

 17:  # distributed under the License is distributed on an "AS IS" BASIS,
 18:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 19:  # See the License for the specific language governing permissions and
 20:  # limitations under the License.
 21:  #
 23:  if RUBY_PLATFORM =~ /mswin|mingw32|windows/
 24>>   require 'windows/error'
 25:    require 'windows/registry'
 26:    require 'windows/process'
 27:    require 'windows/security'
 28:  end
 30:  #helpers for Windows API calls that require privilege adjustments
 31:  class Chef
 32:    class WindowsPrivileged
 33:      if RUBY_PLATFORM =~ /mswin|mingw32|windows/

Running handlers:
[2016-02-08T09:31:54-08:00] ERROR: Running exception handlers
Running handlers complete
[2016-02-08T09:31:54-08:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 minutes 44 seconds


Johnny5 February 2016

Found solution with help from a friend.

chef-client versions > 12.5 will need to install a gem

gem install windows-pr

To find this solution, go to the cookbook github repo and search in the "issues" there. That's the method, here's the direct link: https://github.com/chef-cookbooks/windows/issues/276

Post Status

Asked in February 2016
Viewed 3,148 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life