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 )
As Prakash Murthy said, It was missing ruby-wmi files. Thought it will help if anyone get stuck again
I did run these commands
Got one more error
So i would recommend
(i) check gem installed ( in CMD )
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.
Newer versions of Chef do not use ruby-wmi, so you should not need the gem. I got this error while trying to run test kitchen, and I have tried the solutions above but they didn't work.
This worked for me:
After that kitchen runs fine.
The error message
cannot load such file -- ruby-wmi (LoadError)
is coming up becausechef-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: