我试图提高一些Linux虚拟机与Vagrant,然而,我遇到了这个错误每次.我甚至重新安装流浪汉,但没有帮助到目前为止。
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/focal64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/focal64'
default: URL: https://vagrantcloud.com/ubuntu/focal64
==> default: Adding box 'ubuntu/focal64' (v20230803.0.0) for provider: virtualbox
C:/Users/Alex/.vagrant.d/gems/3.1.3/gems/rubyhacks-0.1.5/lib/rubyhacks.rb:342:in `-@': can't modify frozen String: "=" (FrozenError)
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/3.1.0/rubygems/requirement.rb:114:in `parse'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/3.1.0/rubygems/requirement.rb:138:in `block in initialize'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/3.1.0/rubygems/requirement.rb:138:in `map!'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/3.1.0/rubygems/requirement.rb:138:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/box_collection.rb:280:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/box_collection.rb:280:in `block in find'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/box_collection.rb:278:in `map'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/box_collection.rb:278:in `find'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/box_add.rb:325:in `box_add'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/box_add.rb:293:in `add_from_metadata'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/box_add.rb:128:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/handle_box.rb:83:in `handle_box'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/handle_box.rb:42:in `block in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/handle_box.rb:36:in `synchronize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/handle_box.rb:36:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/call.rb:53:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/providers/virtualbox/action/check_virtualbox.rb:20:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:248:in `action_raw'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:217:in `block in action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:631:in `lock'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
有人遇到过这样的问题吗?
我尝试重新安装Vagrant,但它没有解决问题。
1条答案
按热度按时间zlhcx6iw1#
这些错误都指向了ruby的问题。不同版本的vagrant有不同的错误,这表明ruby的版本是错误的。Vagrant需要特定版本的ruby才能正常运行。
根据documentation,应该有一个名为
vagrant.gemspec
的文件,它指定了这个版本的vagrant需要的ruby版本。使用ruby -v
应该会显示您正在使用的版本。如果两者不同,修复方法是安装所需的ruby版本。