mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

dependency problems with Ubuntu 12.04 Vagrant 1.9.0 #492

Closed riebling closed 7 years ago

riebling commented 7 years ago

OS: Ubuntu 12.04 Vagrant version: vagrant_1.9.0_x86_64.deb Try vagrant plugin install vagrant-aws

er1k@islpc22:~/boxes/xenial-AWS/dummy$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
er1k@islpc22:~/boxes/xenial-AWS/dummy$ gem --version
1.8.11

er1k@islpc22:~/boxes/xenial-AWS/dummy$ vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'fog-xml' (>= 0) among 45 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/opt/vagrant/embedded/gems', execute `gem env` for more information
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:1311:in `block in activate_dependencies'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:1300:in `each'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:1300:in `activate_dependencies'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/specification.rb:1282:in `activate'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/bundler.rb:319:in `block in activate_solution'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/bundler.rb:316:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/bundler.rb:316:in `activate_solution'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/bundler.rb:244:in `internal_install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/bundler.rb:97:in `install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/plugin/manager.rb:62:in `block in install_plugin'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/plugin/manager.rb:72:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/plugin/manager.rb:72:in `install_plugin'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/action/install_gem.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/command/base.rb:14:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/command/install.rb:32:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/command/install.rb:31:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/command/install.rb:31:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/commands/plugin/command/root.rb:66:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/environment.rb:308:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.0/bin/vagrant:123:in `<main>'

The same happens even if I (tried to) remove all traces of Ruby from my system (because I suspected a failed Ruby install may have been the initial cause of this behavior) - I'm really not sure how Vagrant's dependency on Ruby is meant to work, or "just work" or, in this case, "not work" :-/

riebling commented 7 years ago

And that comment led me to a solution, should anyone else receive these errors! The fix:

sudo rm -rf /var/lib/gems

Now this plugin can install happily. (who knew?)

er1k@islpc22:~/boxes/xenial-AWS/dummy$ vagrant plugin install vagrant-sshfs
Installing the 'vagrant-sshfs' plugin. This can take a few minutes...
Installed the plugin 'vagrant-sshfs (1.3.0)'!
riebling commented 7 years ago

Nope. Doesn't help. Tried installing the wrong plugin, vagrant-sshfs, which installed OK. vagrant-aws still heaps piles of gripes about gems on us.

riebling commented 7 years ago

Trying suggested commands to determine source of problem leads to advice to run gem install fog-xml, the results:

er1k@islpc22:~/boxes/xenial-AWS/dummy$ sudo gem install fog-xml
Fetching: builder-3.2.2.gem (100%)
Fetching: excon-0.54.0.gem (100%)
Fetching: formatador-0.2.5.gem (100%)
Fetching: fog-core-1.43.0.gem (100%)
Fetching: mini_portile2-2.1.0.gem (100%)
ERROR:  Error installing fog-xml:
    mini_portile2 requires Ruby version >= 1.9.2.
riebling commented 7 years ago

Fixed it after realizing it was due to misleading error message. Here is how the error message reads:

This is usually caused by manual tampering with the 'plugins.json'
file in the Vagrant home directory. To fix this error, please
remove that file

Here is how it should read

This is usually caused by manual tampering with the 'plugins.json'
file in the ~/.vagrant.d directory. To fix this error, please
remove that file

because there is also a plugins.json to be found in /opt/vagrant, which one might assume is Vagrant's home directory, but one would be wrong. "the Vagrant home directory" is imprecise, ambiguous, and misleading

manishmahabir commented 6 years ago

wget -c https://releases.hashicorp.com/vagrant/2.0.3/vagrant_2.0.3_x86_64.deb sudo dpkg -i vagrant_2.0.3_x86_64.deb