无法加载此类文件 – ruby​​-wmi(LoadError)&无法加载此类文件 – win32 / service(LoadError)

前端之家收集整理的这篇文章主要介绍了无法加载此类文件 – ruby​​-wmi(LoadError)&无法加载此类文件 – win32 / service(LoadError)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我确实安装了下面提到的ruby东西

当我尝试执行chef-client时,我收到下面提到的错误

c:\RubyDevKit>chef-client
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- ruby-wmi (LoadError)
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/provider/env/windows.rb:20:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/providers.rb:49:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef.rb:25:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/bin/chef-client:23:in `<top (required)>'
        from C:/Ruby193/bin/chef-client:23:in `load'
        from C:/Ruby193/bin/chef-client:23:in `<main>'

Ruby193文件夹结构(缺失)

解决方法

错误消息无法加载此类文件 – ruby​​-wmi(LoadError)即将到来,因为chef-client无法找到所需的gem.

此问题在Opscode/Chef wiki page on Common Errors中得到解决.

如前所述,使用以下命令安装所需的gem:

C:\> gem install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
C:\> gem install rdp-ruby-wmi
原文链接:https://www.f2er.com/ruby/269384.html

猜你在找的Ruby相关文章