无法加载这样的文件 - ruby​​-wmi(LoadError)&无法加载这样的文件--win32 / service(LoadError) [英] cannot load such file -- ruby-wmi (LoadError) & cannot load such file -- win32/service (LoadError)

查看:158
本文介绍了无法加载这样的文件 - 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':无法加载这样的文件 - ruby​​-wmi(LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in'require'$来自C的b $ b:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/provider/env/windows.rb:20:在< top(required)> ;'C中的
:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:在'require'中
从C:/ Ruby193 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / custom_require.rb:36:在'require'中
来自C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-10.14.4/lib/chef/providers。 rb:49:在< top(requ ired)>'
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:在< top(required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in'require'$ b $ C从C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:在'require'
从C:/Ruby193/lib/ruby/gems/1.9.1/ gems / chef-10.14.4 / bin / chef-client:23:在`< top(required)>'中从$ C $ /
/ bin / chef-client:23:在`load'
from C:/ Ruby193 / bin / chef-client:23:在< main>中

Ruby193文件夹结构(Missing)

解决方案

错误m essage 无法加载这样的文件 - ruby​​-wmi(LoadError)即将到来,因为 chef-client 无法找到所需的宝石。

这个问题在 Opscode /关于常见错误的厨师维基页面


$ b

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

  C:\> gem install win32-open3 ruby​​-wmi windows-api windows-pr --no-rdoc --no-ri --verbose 
C:\> gem install rdp-ruby-wmi


I did install below mentioned ruby stuff

when i try executing chef-client, i receive below mentioned error

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 folder Structure ( Missing )

解决方案

The error message cannot load such file -- ruby-wmi (LoadError) is coming up because chef-client cannot find the required gems.

This issue is addressed on the Opscode/Chef wiki page on Common Errors.

As mentioned there, install the required gems with the following commands:

C:\> gem install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
C:\> gem install rdp-ruby-wmi

这篇关于无法加载这样的文件 - ruby​​-wmi(LoadError)&amp;无法加载这样的文件--win32 / service(LoadError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆