hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

`vagrant plugin install` not working on latest vagrant 2.3.7 #13261

Closed ahasunos closed 5 months ago

ahasunos commented 10 months ago

Debug output

Please expand to see the debug log

``` INFO runner: Running action: environment_unload # /opt/vagrant/embedded/lib/ruby/3.1.0/rubygems/specification.rb:2278:in `check_version_conflict': can't activate json-2.6.3, already activated json-2.6.1 (Gem::LoadError) from /opt/vagrant/embedded/lib/ruby/3.1.0/rubygems/specification.rb:1415:in `activate' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/bundler.rb:756:in `block in activate_solution' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/bundler.rb:753:in `each' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/bundler.rb:753:in `activate_solution' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/bundler.rb:593:in `internal_install' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/bundler.rb:355:in `install' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/manager.rb:138:in `block in install_plugin' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/manager.rb:148:in `install_plugin' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/action/install_gem.rb:30:in `call' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/command/base.rb:14:in `action' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/command/install.rb:70:in `block in execute' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/command/install.rb:69:in `each' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/command/install.rb:69:in `execute' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/commands/plugin/command/root.rb:66:in `execute' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/cli.rb:67:in `execute' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:301:in `cli' from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant:248:in `
' ```

Expected behavior

It should be able to install plugin

Actual behavior

Crashing with issue of can't activate json-2.6.3, already activated json-2.6.1 (Gem::LoadError)

Reproduction information

Vagrant version

2.3.7

Host operating system

MacOS Ventura 13.5

Guest operating system

Steps to reproduce

  1. Install vagrant 2.3.7 from https://developer.hashicorp.com/vagrant/downloads
  2. Install plugin: vagrant plugin install vagrant-aws --debug

NOTE: The same works correctly for vagrant version 2.3.4

Please feel free to close the issue if:

nloveupgrade commented 9 months ago

I had this issue as well. I'm running an M1 mac (arm64) and it looks like the issue started (as far as I can tell) on the first version Hashicorp started publishing arm64 versions of vagrant: 2.3.5.

A work around until they fix it is to:

  1. Move them json 2.6.1 gemspec file so it's no long used
    mv /opt/vagrant/embedded/lib/ruby/gems/3.1.0/specifications/default/json-2.6.1.gemspec /opt/vagrant/embedded/lib/ruby/gems/3.1.0/specifications/default/json-2.6.1.gemspec.bak
  2. In the file /opt/vagrant/embedded/lib/ruby/3.1.0/json/version.rb change VERSION = '2.6.1' to `VERSION = '2.6.3'

After those steps you should be able to run vagrant plugin install vagrant-aws

stephenthedev commented 7 months ago

2. /opt/vagrant/embedded/lib/ruby/3.1.0/json/version.rb

this also worked for a fresh ubuntu install on wsl2 :-)

xeacott commented 5 months ago

THIS DID THE TRICK!