无法加载此类文件 - chef / mixin / language

时间:2018-04-18 21:12:11

标签: chef chef-recipe cookbook

我正在使用Kitchen在我的本地机器上测试一本烹饪书。我得到以下错误。

    Recipe Compile Error in /tmp/kitchen/cache/cookbooks/windows/libraries/windows_package.rb
I, [2018-04-18T15:52:46.333373 #55288]  INFO -- default-ubuntu-1404: ================================================================================
I, [2018-04-18T15:52:46.333444 #55288]  INFO -- default-ubuntu-1404: 
I, [2018-04-18T15:52:46.333714 #55288]  INFO -- default-ubuntu-1404: LoadError
I, [2018-04-18T15:52:46.333755 #55288]  INFO -- default-ubuntu-1404: ---------
I, [2018-04-18T15:52:46.333933 #55288]  INFO -- default-ubuntu-1404: cannot load such file -- chef/mixin/language
I, [2018-04-18T15:52:46.333976 #55288]  INFO -- default-ubuntu-1404: 
I, [2018-04-18T15:52:46.334003 #55288]  INFO -- default-ubuntu-1404: Cookbook Trace:
I, [2018-04-18T15:52:46.334036 #55288]  INFO -- default-ubuntu-1404: ---------------
I, [2018-04-18T15:52:46.334059 #55288]  INFO -- default-ubuntu-1404:   /tmp/kitchen/cache/cookbooks/windows/libraries/windows_package.rb:7:in `<top (required)>'
I, [2018-04-18T15:52:46.334082 #55288]  INFO -- default-ubuntu-1404: 
I, [2018-04-18T15:52:46.334365 #55288]  INFO -- default-ubuntu-1404: Relevant File Content:
I, [2018-04-18T15:52:46.334399 #55288]  INFO -- default-ubuntu-1404: ----------------------
I, [2018-04-18T15:52:46.334463 #55288]  INFO -- default-ubuntu-1404: /tmp/kitchen/cache/cookbooks/windows/libraries/windows_package.rb:
I, [2018-04-18T15:52:46.334600 #55288]  INFO -- default-ubuntu-1404: 
I, [2018-04-18T15:52:46.334826 #55288]  INFO -- default-ubuntu-1404:   1:  require 'chef/resource/lwrp_base'
I, [2018-04-18T15:52:46.334870 #55288]  INFO -- default-ubuntu-1404:   2:  require 'chef/provider/lwrp_base'
I, [2018-04-18T15:52:46.334919 #55288]  INFO -- default-ubuntu-1404:   3:  
I, [2018-04-18T15:52:46.334956 #55288]  INFO -- default-ubuntu-1404:   4:  require 'win32/registry' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
I, [2018-04-18T15:52:46.334981 #55288]  INFO -- default-ubuntu-1404:   5:  
I, [2018-04-18T15:52:46.335013 #55288]  INFO -- default-ubuntu-1404:   6:  require 'chef/mixin/shell_out'
I, [2018-04-18T15:52:46.335314 #55288]  INFO -- default-ubuntu-1404:   7>> require 'chef/mixin/language'
I, [2018-04-18T15:52:46.335425 #55288]  INFO -- default-ubuntu-1404:   8:  class Chef
I, [2018-04-18T15:52:46.335457 #55288]  INFO -- default-ubuntu-1404:   9:    class Provider
I, [2018-04-18T15:52:46.335483 #55288]  INFO -- default-ubuntu-1404:  10:      class WindowsCookbookPackage < Chef::Provider::LWRPBase
I, [2018-04-18T15:52:46.335508 #55288]  INFO -- default-ubuntu-1404:  11:        include Chef::Mixin::ShellOut
I, [2018-04-18T15:52:46.335531 #55288]  INFO -- default-ubuntu-1404:  12:        include Windows::Helper
I, [2018-04-18T15:52:46.335556 #55288]  INFO -- default-ubuntu-1404:  13:  
I, [2018-04-18T15:52:46.335579 #55288]  INFO -- default-ubuntu-1404:  14:        # the logic in all action methods mirror that of
I, [2018-04-18T15:52:46.335638 #55288]  INFO -- default-ubuntu-1404:  15:        # the Chef::Provider::Package which will make
I, [2018-04-18T15:52:46.335669 #55288]  INFO -- default-ubuntu-1404:  16:        # refactoring into core chef easy
I, [2018-04-18T15:52:46.335872 #55288]  INFO -- default-ubuntu-1404: 
I, [2018-04-18T15:52:46.336010 #55288]  INFO -- default-ubuntu-1404: System Info:
I, [2018-04-18T15:52:46.336042 #55288]  INFO -- default-ubuntu-1404: ------------
I, [2018-04-18T15:52:46.336067 #55288]  INFO -- default-ubuntu-1404: chef_version=14.0.202
I, [2018-04-18T15:52:46.336090 #55288]  INFO -- default-ubuntu-1404: platform=ubuntu
I, [2018-04-18T15:52:46.336112 #55288]  INFO -- default-ubuntu-1404: platform_version=14.04
I, [2018-04-18T15:52:46.336134 #55288]  INFO -- default-ubuntu-1404: ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
I, [2018-04-18T15:52:46.336158 #55288]  INFO -- default-ubuntu-1404: program_name=/opt/chef/bin/chef-client
I, [2018-04-18T15:52:46.336186 #55288]  INFO -- default-ubuntu-1404: executable=/opt/chef/bin/chef-client

我知道有一些mixins已从主厨客户端版本&gt;中删除14。*

我想知道为什么要安装此软件包以及如何更正此问题?

1 个答案:

答案 0 :(得分:7)

在Chef 14中确实删除了mixin,但该文件已在该cookbook 3.0版中删除,因为windows_package资源已移至Chef核心。如果您将该食谱升级到最新版本(或者只是3.0以上的版本),它应该可以正常工作。