vagrant-libvirt: Install error: in `all=': undefined method `group_by' for nil:NilClass (NoMethodError)

I tried following the installation instructions but am stuck on the vagrant plugin install vagrant-libvirt step.

I am running debian stretch. I have never previously used vagrant. I do, however, use libvirt VMs and wanted to experiment with using vagrant in my libvirt environment.

I installed vagrant using apt-get – I have vagrant 1.8.1. And Ruby 2.3.

At the plugin installation step I get the following error:

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=': undefined method `group_by' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem'
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install'
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin'
    from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
    from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
    from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute'
    from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli'
    from /usr/bin/vagrant:173:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 32 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Could you try purging the Debian vagrant package and installing from https://www.vagrantup.com/downloads.html?

It may be a packaging issue on the debian side - I’m running sid here with the upstream package and haven’t seen this before.

To quick-fix the issue, try this command:

sudo sed -i'' "s/Specification.all = nil/Specification.reset/" /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb

to patch bundler.rb file.

For Ubuntu 16.04, replacing with the upstream package works as well, thanks @infernix

That worked, using the upstream package (1:1.8.1).

I have reported the debian bug (#818237).

Thanks for the help.

I want to use Vagrant 1.8 from Ubuntu 16.04 and I am facing this problem too… 😦

I’ll stick with Vagrant from Ubuntu repos for now, I don’t like to install packages from outside of distro’s repositories, I hope that this will be fixed soon!

Reported on Launchpad as well:

https://bugs.launchpad.net/ubuntu/+source/vagrant/+bug/1562696

@kenorb command sudo sed -i’’ “s/Specification.all = nil/Specification.reset/” /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb solved my problem.

This has been fixed in upstream.

In the meantime, here is a simple patch by Debian dev Christian Hofstaedtler for /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb :

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818237#28

This fixed the issue for me (a test install with Ubuntu 16.04).

sudo sed -i'' "s/Specification.all = nil/Specification.reset/" /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb

Solved my problem too. Is there a better solution?

Updating Vagrant from 1.8.1 to 1.8.4 has fixed the problem. Thanks @infernix

Thanks @kenorb, your quick-fix helped me as well.

👍 @kenorb

Works for me… Thanks so much…

Huzaa for @kenorb - am now able to install plugins such as bindfs again. (Note that i had to manually install zlib1g-dev for that) Running 16.04 and Vagrant 1.8.1. Thanks!

@kenorb quick fix is working. thx! works at least for installation

@ertay I wiped my entire system and reinstalled ubuntu 15.10 because I never had issues before I upgraded to 16.04. I ran into a lot of other system issues running 16.04 so going back to 15.10 made life a lot easier. If I ever do decide to risk it all again and upgrade, I am going to wait a long time until a more stable version is out with needed patches.