Rubygems bundles bundler 1.16.1 while we still use bundler 1.14.6 in buildRubyGems:
$ vagrant plugin update
Updating installed plugins...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies bundler (= 1.14.6) and bundler (= 1.16.1)
Activated bundler-1.16.1
which does not match conflicting dependency (= 1.14.6)
Conflicting dependency chains:
bundler (= 1.16.1), 1.16.1 activated
versus:
bundler (= 1.14.6)
Gems matching bundler (= 1.14.6):
bundler-1.14.6
workaround is the following default.nix:
with import <nixpkgs> {
overlays = [
(self: super: {
bundler = super.bundler.overrideAttrs (old: {
name = "bundler-1.16.1";
src = super.fetchurl {
url = "https://rubygems.org/gems/bundler-1.16.1.gem";
sha256 = "1s2nq4qnffxg3kwrk7cnwxcvfihlhxm9absl2l6d3qckf3sy1f22";
};
});
})
];
};
stdenv.mkDerivation {
name = "env";
buildInputs = [
vagrant
];
}
$ nix-shell --command 'vagrant plugin update'
Updating installed plugins...
All plugins are up to date.
I have no idea how to upgrade bundler without an overlay. bundlerEnv and buildRubyGems is a miracle to me.
"x86_64-linux"Linux 4.15.7, NixOS, 18.09.git.63ddf1b (Impala)yesyesnix-env (Nix) 2.0/home/joerg/git/nixpkgsThis expression is more compact and suitable for global installation:
(import <nixpkgs> {
overlays = [
(self: super: {
bundler = super.bundler.overrideAttrs (old: {
name = "bundler-1.16.1";
src = super.fetchurl {
url = "https://rubygems.org/gems/bundler-1.16.1.gem";
sha256 = "1s2nq4qnffxg3kwrk7cnwxcvfihlhxm9absl2l6d3qckf3sy1f22";
};
});
})
];
}).vagrant
Quick note as vagrant maintainer - I haven't dived into the depths of bundler enough to understand how vagrant is using it to manage plugins, and I don't use plugins myself, so any support in the current vagrant package for plugins is purely incidental. Happy to have help from others on improving the story around this!
I'm curious where the bundler 1.6.1 requirement is coming from - I don't see it in our gemset.nix for vagrant.
@aneeshusa it is coming from ruby 2.4. rubygems has bundler and this is where vagrant picks it up.
Not sure if this is worth a different bug report, but even with that workaround above I can't install the plugin for libvirt:
$ vagrant plugin install libvirt ~
Installing the 'libvirt' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies ffi (~> 0.6.3) and ffi (= 1.9.18)
Activated ffi-1.9.18
which does not match conflicting dependency (~> 0.6.3)
Conflicting dependency chains:
ffi (= 1.9.18), 1.9.18 activated
versus:
libvirt (> 0), 0.1.0 activated, depends on
ffi (~> 0.6.3)
I did not had this issue when installing this vagrant plugin in a nix-shell some days ago:
$ nix-shell -p libxml2 libvirt zlib ruby.devEnv pkgconfig
I also think this could be a different issue independent from nixpkgs. Neither rubygems nor vagrant have the ffi gem installed at the moment. Are you in project with a Gemfile?
vagrant is installed as a system package according to your overlay post.
And then it's straight up as a user: vagrant plugin install libvirt
Running this in the above nix-shell doesn't change the error.
Also it's not in a project, it's in $HOME without a Gemfile, Vagrantfile and I've run rm -rf ~/{.vagrant*,.gem} first for a clean profile.
I am running 18.03 for other reasons, which may be the difference?
I am on unstable at the moment, which might explain the difference. But I have no time to currently test this on 18.03. Maybe you can do the other way around?
Otherwise the ffi gem could be overwritten in the same way as the bundler gem.
bee172501de3b4496ff81cc1621d307f167e938 is the git revision of nixpkgs, where I could successfully install vagrant-libvirt.
Same situation on unstable. Clean $HOME again without .vagrant and .gem invoked with the nix-shell command from above:
[nix-shell:~]$ vagrant plugin install libvirt
==> vagrant: A new version of Vagrant is available: 2.0.3!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html
Installing the 'libvirt' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies ffi (~> 0.6.3) and ffi (= 1.9.18)
Activated ffi-1.9.18
which does not match conflicting dependency (~> 0.6.3)
Conflicting dependency chains:
ffi (= 1.9.18), 1.9.18 activated
versus:
libvirt (> 0), 0.1.0 activated, depends on
ffi (~> 0.6.3)
- system: `"x86_64-linux"`
- host os: `Linux 4.14.29, NixOS, 18.09pre133621.56fb68dcef4 (Jellyfish)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.0`
- channels(root): `"nixos"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
I tried overwriting the ffi gem the same way the bundler gem was done:
(import <nixpkgs> {
overlays = [
(self: super: {
bundler = super.bundler.overrideAttrs (old: {
name = "bundler-1.16.1";
src = super.fetchurl {
url = "https://rubygems.org/gems/bundler-1.16.1.gem";
sha256 = "1s2nq4qnffxg3kwrk7cnwxcvfihlhxm9absl2l6d3qckf3sy1f22";
};
});
ffi = super.ffi.overrideAttrs (old: {
name = "ffi-1.9.23";
src = super.fetchurl {
url = "https://rubygems.org/gems/ffi-1.9.23.gem";
sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr";
};
});
# ffi = super.ffi.overrideAttrs (old: {
# name = "ffi-1.9.18";
# src = super.fetchurl {
# url = "https://rubygems.org/gems/ffi-1.9.18.gem";
# sha256 = "034f52xf7zcqgbvwbl20jwdyjwznvqnwpbaps9nk18v9lgb1dpx0";
# };
# });
})
];
}).vagrant
As you can see I tried also the latest version because the result doesn't change fro above. It still activated the ffi-1.9.18 gem. I'm quite probable doing something wrong.
@bandresen I've just run in to the same issue. You probably want to install vagrant-libvirt, rather than libvirt.
This is happening again on current nixpkgs master with bundler conflicting between rubygems bundler version 1.16.2 and bundler 1.16.3.
I managed to fix it by patching vagrant like
diff
diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb
index 301e40e37..e361ab510 100644
--- a/lib/vagrant/bundler.rb
+++ b/lib/vagrant/bundler.rb
@@ -217,7 +217,7 @@ module Vagrant
source_list = {}
system_plugins = plugins.map do |plugin_name, plugin_info|
plugin_name if plugin_info["system"]
- end.compact
+ end.compact << "bundler"
installer_set = VagrantSet.new(:both)
installer_set.system_plugins = system_plugins
Most helpful comment
This expression is more compact and suitable for global installation: