Closed jsmartt closed 9 years ago
I am also getting this, with the same thing after a clean install.
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>vagrant -v
Vagrant 1.7.2
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>vagrant plugin list
vagrant-berkshelf (4.0.2)
vagrant-chef-zero (0.7.1)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.4, system)
vagrant-vcenter (0.3.2)
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>vagrant up
Bringing machine 'cbreden-chef1' up with 'virtualbox' provider...
the ffi-yajl and yajl-ruby gems have incompatible C libyajl libs and should not be loaded in the same Ruby VM
falling back to ffi which might work (or might not, no promises)
C:/Users/cbreden/.vagrant.d/gems/gems/chef-11.6.0/lib/chef/provider/env/windows.rb:20:in `require': cannot load such file -- ruby-wmi (LoadError)
from C:/Users/cbreden/.vagrant.d/gems/gems/chef-11.6.0/lib/chef/provider/env/windows.rb:20:in `<top (required)>'
from C:/Users/cbreden/.vagrant.d/gems/gems/chef-11.6.0/lib/chef/providers.rb:51:in `require'
from C:/Users/cbreden/.vagrant.d/gems/gems/chef-11.6.0/lib/chef/providers.rb:51:in `<top (required)>'
...
I tried to shoe-in ruby-wmi to both gem directories like so:
cmd /C "set GEM_HOME=C:/Users/cbreden/.vagrant.d/gems&& C:\HashiCorp\Vagrant\embedded\bin\gem install ruby-wmi --no-ri --no-rdoc"
cmd /C "set GEM_HOME=C:/HashiCorp/Vagrant/embedded/gems&& C:\HashiCorp\Vagrant\embedded\bin\gem install ruby-wmi --no-ri --no-rdoc"
...but to no avail. I'm scouting for some specific configuration file somewhere that is preventing ruby-wmi from being loaded, but haven't found anything yet.
For what it's worth, I am also seeing this problem on Windows 7. Vagrant 1.6.5.
Seeing this issue on Windows 8.1 and Vagrant 1.7.2
I never used it on windows, but a colleague of mine who did told me that the plugin makes use of the lsof
tool to find the process id of chef-zero. AFAIK lsof
a unix/linux tool and it is not available on Windows.
It is used here: https://github.com/schubergphilis/vagrant-chef-zero/blob/f635cf5084ebc650605f7c5924ec1e70f612741e/lib/vagrant-chef-zero/server_helpers.rb#L124
Now regarding the error @jsmartt posted, it seems the vagrant environment is missing a gem called ruby-wmi. I would expect that vagrant install would pull that in. That should be required to run the plugin on windows, the strange thing is that it was not installed.
The gem install
command posted by @cbreden should have installed it.
@cbreden could you please post the output of:
C:\HashiCorp\Vagrant\embedded\bin\gem list
ping @electrofelix
Do you have any input regarding this issue?
BTW: from the posts of @jsmartt @cbreden you both seem to be running an old version of the plugin. The latest version is v1.0.1
@joelwilson @spifrancisv What versions are you using?
$ vagrant plugin list
vagrant-berkshelf (4.0.4)
vagrant-chef-zero (1.0.1)
vagrant-hostmanager (1.5.0)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3, system)
vagrant-vbguest (0.10.0)
Hi , Same issue for me and same versions
Upgraded to 1.0.1 but still have the same issue:
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>vagrant -v
Vagrant 1.7.2
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>vagrant plugin list
vagrant-berkshelf (4.0.4)
vagrant-chef-zero (1.0.1)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.4, system)
vagrant-vcenter (0.3.2)
C:\Users\cbreden\Documents\vagrant\c-vbox1\the_commons>C:\HashiCorp\Vagrant\embedded\bin\gem list
*** LOCAL GEMS ***
bigdecimal (1.2.0)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
ruby-wmi (0.4.0)
test-unit (2.0.0.0)
Thanks everyone. I will look into this ASAP (that means probably tomorrow otherwise the day after).
I believe that there is a second gem required on Windows. I can only assume the following piece of code is not getting properly executed in this case.
# Windows platform requirements to run chef-zero
platforms :mswin, :mingw do
gem "ruby-wmi"
gem "win32-service"
end
The list of platforms may not be sufficient, it may be necessary to tweak the list.
Suggest running the following on the system missing the gems.
ruby -e "p RbConfig::CONFIG['host_os']"
May need to go through the various options suggested on http://stackoverflow.com/a/8699106/1597808 to see which gives sensible result.
That's a good find!
C:\>ruby -e "p RbConfig::CONFIG['host_os']"
"mingw32"
Indeed adding :mingw32
to the Gemfile fixes it for me on Windows 2012 R2.
I will add this to the Gemfile in the repo (via PR), and you guys can install the plugin from source to test:
git clone https://github.com/miguelaferreira/vagrant-chef-zero.git
git checkout -b fix-windows-gem-build origin/fix-windows-gem-build
cd vagrant-chef-zero
gem build .\vagrant-chef-zero.gemspec
vagrant plugin install .\vagrant-chef-zero-1.0.1.gem
Let me know how it works out.
Well done it's working perfectly for me
PS: 06/03/2015 16:46:03>vagrant plugin list
vagrant-berkshelf (4.0.4)
vagrant-chef-zero (1.0.1)
It is now broken on non-windows platforms https://travis-ci.org/schubergphilis/vagrant-chef-zero/builds/65252216
Will work on that before having thePR #73 merged
Travis is happy again, we can proceed with merging. https://travis-ci.org/schubergphilis/vagrant-chef-zero/builds/65365063
After installing vagrant-chef-zero on my Windows 7 machine, vagrant is no longer able to create VMs, even when the chef-zero provisioner is not used. Here's the error I got:
Vagrant Plugins:
Relevant gems:
Then I uninstall the vagrant-chef-zero plugin and it runs fine. Before uninstalling the plugin, I also tried updating the relevant gems, using older versions of libyajl, yajl-ruby, and ffi-yajl. I even tried uninstalling chefdk and all the gems, then reinstalling a clean version, but no luck.