Closed ichilton closed 8 years ago
Hi @ichilton
This is an issue with the libvirt plugin. Vagrant uses nokogiri internally, and requires a newer version than what the plugin author of libvirt has allowed. Unfortunately Vagrant cannot downgrade. Can you please open an issue with that plugin maintainer? Thanks!
Hi @sethvargo
I just tried again the other day and with this workaround: https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt it successfully installs now.
Thanks,
Ian
The workaround from @ichilton is Linux-specific. I have the nokogiri version conflict on MacOs and moving around linux shared libraries won't help vagrant on Mac get around this.
I'll have to go find the hacks for monkey-patching libvirt itself.
This was a pain to accomplish:
vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Installed the plugin 'vagrant-libvirt (0.0.32)'!
I had to track down the patch for OSX. Then, I built the ruby-libvirt gem for the systemwide gems -- this didn't work. I built it for the embedded gems of vagrant -- this didn't work. Turns out, each user has their own set of vagrant gems as well. I built and installed the patched gem into my local vagrant gem set -- this did work. Geez.
libvirt for OSX can be installed from http://brewformulas.org/Libvirt with:
brew install libvirt
The source for the gemfile is available at https://rubygems.org/gems/ruby-libvirt/versions/0.6.0
The patch for ext/libvirt/extconf.rb is:
# right after the require 'mkmf' line...
$defs.push("-DHAVE_VIRDOMAINQEMUMONITORCOMMAND")
Once the gem is local and patched, cd into its root directory and rake the gem -- but you have to point to where ruby and libvirt are on your particular machine. The following tells the make in the rake where to find the ruby dynamic library and where to find the libvirt headers and library:
CONFIGURE_ARGS="with-opt-lib=/usr/local/lib/ with-libvirt-include=/usr/local/include/ with-libvirt-lib=/usr/local/lib/libvirt" rake -B
Run rake package
to bundle up the modified gem.
Once the gem is packaged, the following will install it not into the system set, not into vagrant's embedded set, but into your user's vagrant's set:
CONFIGURE_ARGS="with-opt-lib=/usr/local/lib/ with-libvirt-include=/usr/local/include/ with-libvirt-lib=/usr/local/lib/libvirt" /opt/vagrant/embedded/bin/gem install --local pkg/ruby-libvirt-0.6.0.gem --install-dir /Users/YOURID/.vagrant.d/gems
Then, finally!, you can run the vagrant plugin install vagrant-libvirt
command and get success.
Now, I'm off to discover if this hacked up plugin works! ;-)
Looks like dependencies in vagrant 1.7.4 are stopping some plugins installing.
On a clean ArchLinux install:
Is this a plugin maintainers problem, or can it be fixed/worked around from the vagrant side?
Thanks,
Ian