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
As Prakash Murthy said, It was missing ruby-wmi files. Thought it will help if anyone get stuck again
I did run these commands
C:\> gem install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
C:\> gem install rdp-ruby-wmi
Got one more error
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- win32/service (LoadError)
So i would recommend
(i) check gem installed ( in CMD )
gem list
this will pointout missing gems, in my case win32/service was misisng
(ii) gem install win32-service
check gem list again to make sure & should fix the problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With