sprotheroe / vagrant-disksize

Vagrant plugin to resize disks in VirtualBox
MIT License
479 stars 51 forks source link

plugin installation problem: fog-libvirt 0.5.0 vs 0.6.0 + RDoc problem #29

Open attila123 opened 5 years ago

attila123 commented 5 years ago

Update: ooops, now I see in the readme that this plugin is only supposed to work with the virtualbox provider. Maybe it would be nice to check the provider and display an unambiguous ("foolproof") error message if the provider is not virtualbox - if possible.

Hi, I have problem installing the plugin on Manjaro linux. Unfortunately I am not familiar with ruby, so I request some help solving this. Versions: vagrant 2.2.3

$ pacman -Q | grep ruby
ruby 2.6.0-5
rubygems 3.0.2-3

vargrant plugin list before the installation:

vagrant-docker-compose (1.3.0, global)
  - Version Constraint: > 0
vagrant-ignition (0.0.3, global)
  - Version Constraint: > 0
vagrant-libvirt (0.0.45, global)
  - Version Constraint: > 0
vagrant-openstack-provider (0.13.0, global)
  - Version Constraint: > 0
vagrant-proxyconf (2.0.0, global)
  - Version Constraint: > 0
vagrant-vbguest (0.17.2, global)
  - Version Constraint: > 0

First attempt to install the plugin:

$ vagrant plugin install vagrant-disksize
Installing the 'vagrant-disksize' plugin. This can take a few minutes...
Building native extensions. This could take a while...
/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /home/avangel/.local/share/flatpak/exports/bin in PATH, mode 040777
Building native extensions. This could take a while...
Fetching fog-libvirt-0.6.0.gem
Fetching vagrant-disksize-0.1.3.gem
Traceback (most recent call last):
    19: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/bin/vagrant:182:in `<main>'
    18: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/environment.rb:291:in `cli'
    17: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/cli.rb:58:in `execute'
    16: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/root.rb:66:in `execute'
    15: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `execute'
    14: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `each'
    13: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:70:in `block in execute'
    12: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/base.rb:14:in `action'
    11: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    10: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
     9: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
     8: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
     7: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
     6: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/action/install_gem.rb:30:in `call'
     5: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/plugin/manager.rb:167:in `install_plugin'
     4: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:232:in `clean'
     3: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:232:in `each'
     2: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:241:in `block in clean'
     1: from /usr/lib/ruby/2.6.0/rubygems/uninstaller.rb:162:in `uninstall_gem'
/usr/lib/ruby/2.6.0/rubygems/uninstaller.rb:264:in `remove': uninitialized constant Gem::RDoc (NameError)

OK I googled that this may be some dependency problem with ruby 2.6, so I installed ruby-rdoc (from distro package): sudo pacman -S ruby-rdoc which installed ruby-rdoc-6.1.1-3. Second attempt to install the plugin:

$ vagrant plugin install vagrant-disksize
Installing the 'vagrant-disksize' plugin. This can take a few minutes...
Traceback (most recent call last):
    21: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/bin/vagrant:182:in `<main>'
    20: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/environment.rb:291:in `cli'
    19: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/cli.rb:58:in `execute'
    18: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/root.rb:66:in `execute'
    17: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `execute'
    16: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `each'
    15: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:70:in `block in execute'
    14: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/base.rb:14:in `action'
    13: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    12: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
    11: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
    10: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
     9: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
     8: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/action/install_gem.rb:30:in `call'
     7: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/plugin/manager.rb:148:in `install_plugin'
     6: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/plugin/manager.rb:138:in `block in install_plugin'
     5: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:133:in `install'
     4: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:348:in `internal_install'
     3: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:468:in `generate_plugin_set'
     2: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:468:in `each'
     1: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:474:in `block in generate_plugin_set'
/opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:474:in `write': No such file or directory @ rb_sysopen - /home/avangel/.vagrant.d/gems/2.6.0/gems/fog-libvirt-0.5.0/fog-libvirt.gemspec (Errno::ENOENT)

So I thought that the problem may be that vagrant is looking for fog-libvirt-0.5.0, but the plugin installed fog-libvirt-0.6.0 (again, I am not familiar with ruby).

Update: deleted irrelevant part me trying to do gem install fog-libvirt -v 0.5.0. I realized that's not a solution as this would not install it under vagrant.

Update: I realized the problem is that fog-libvirt 0.5.0 is still not installed under ~/.vagrant.d/gems/2.6.0/gems. So I tried to install it (not sure if it is correct, I did it after a quick search):

export GEM_HOME=${HOME}/.vagrant.d/gems/2.6.0/gems
$ gem install fog-libvirt -v 0.5.0
Fetching fog-libvirt-0.5.0.gem
/usr/lib/ruby/2.6.0/rubygems/installer.rb:704: warning: Insecure world writable dir /home/avangel/.local/share/flatpak/exports/bin in PATH, mode 040777
WARNING:  You don't have /home/avangel/.gem/ruby/2.6.0/bin in your PATH,
      gem executables will not run.
Successfully installed fog-libvirt-0.5.0
Parsing documentation for fog-libvirt-0.5.0
Installing ri documentation for fog-libvirt-0.5.0
Done installing documentation for fog-libvirt after 0 seconds
1 gem installed

Still not OK:

$ find ~/.vagrant.d -name '*fog-libvirt*'
/home/avangel/.vagrant.d/gems/2.6.0/gems/fog-libvirt-0.6.0
/home/avangel/.vagrant.d/gems/2.6.0/gems/fog-libvirt-0.6.0/fog-libvirt.gemspec
/home/avangel/.vagrant.d/gems/2.6.0/gems/cache/fog-libvirt-0.5.0.gem
/home/avangel/.vagrant.d/gems/2.6.0/specifications/fog-libvirt-0.6.0.gemspec
/home/avangel/.vagrant.d/gems/2.6.0/specifications/fog-libvirt-0.5.0.gemspec
/home/avangel/.vagrant.d/gems/2.6.0/cache/fog-libvirt-0.6.0.gem

Now I decided to try a brute force hack to fake fog-libvirt 0.5.0 with 0.6.0 by creating this symlink: ln -s ~/.vagrant.d/gems/2.6.0/gems/fog-libvirt-0.6.0 ~/.vagrant.d/gems/2.6.0/gems/fog-libvirt-0.5.0 Some rdoc problem happened again :(

$ vagrant plugin install vagrant-disksize
Installing the 'vagrant-disksize' plugin. This can take a few minutes...
Building native extensions. This could take a while...
/usr/lib/ruby/2.6.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /home/avangel/.local/share/flatpak/exports/bin in PATH, mode 040777
Building native extensions. This could take a while...
Traceback (most recent call last):
    19: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/bin/vagrant:182:in `<main>'
    18: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/environment.rb:291:in `cli'
    17: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/cli.rb:58:in `execute'
    16: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/root.rb:66:in `execute'
    15: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `execute'
    14: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:69:in `each'
    13: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/install.rb:70:in `block in execute'
    12: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/command/base.rb:14:in `action'
    11: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `run'
    10: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/util/busy.rb:19:in `busy'
     9: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/runner.rb:66:in `block in run'
     8: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/builder.rb:116:in `call'
     7: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/action/warden.rb:34:in `call'
     6: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/plugins/commands/plugin/action/install_gem.rb:30:in `call'
     5: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/plugin/manager.rb:167:in `install_plugin'
     4: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:232:in `clean'
     3: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:232:in `each'
     2: from /opt/vagrant/embedded/gems/gems/vagrant-2.2.3/lib/vagrant/bundler.rb:241:in `block in clean'
     1: from /usr/lib/ruby/2.6.0/rubygems/uninstaller.rb:162:in `uninstall_gem'
/usr/lib/ruby/2.6.0/rubygems/uninstaller.rb:264:in `remove': uninitialized constant Gem::RDoc (NameError)