vagrant 启动错误解决
之前一直启动正常,突然一天启动的时候报了如下错误。通过各种尝试,在vagrantfile中添加了如下代码后便可启动了。
报错
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default : Checking if box 'centos/7' version '1902.01' is up to date... ==> default : Clearing any previously set forwarded ports... ==> default : Clearing any previously set network interfaces... ==> default : Preparing network interfaces based on configuration... default : Adapter 1: nat default : Adapter 2: hostonly ==> default : Forwarding ports... default : 22 (guest) => 2221 (host) (adapter 1) ==> default : Booting VM... ==> default : Waiting for machine to boot. This may take a few minutes... default : SSH address: 127.0.0.1:2221 default : SSH username: vagrant default : SSH auth method: private key ==> default : Machine booted and ready! [ default ] GuestAdditions 5.2.22 running --- OK. ==> default : Checking for guest additions in VM... ==> default : Configuring and enabling network interfaces... ==> default : Rsyncing folder: /cygdrive/c/myvagrant/Borg-web/borg/ => /vagrant C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/io.rb:32: in `encode': "\x83\xBC" from Windows-31J to UTF-8 (Encoding::UndefinedConversionError) from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/io.rb:32: in `read_until_block' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:194: in `block in execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:192: in `each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:192: in `execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:22: in `execute' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/synced_folders/rsync/helper.rb:215: in `rsync_single' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/synced_folders/rsync/synced_folder.rb:48: in `block in enable' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/synced_folders/rsync/synced_folder.rb:47: in `each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/synced_folders/rsync/synced_folder.rb:47: in `enable' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/synced_folders.rb:93: in `block in call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/synced_folders.rb:90: in `each' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/synced_folders.rb:90: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/before_trigger.rb:23: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/after_trigger.rb:26: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/before_trigger.rb:23: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/builtin/after_trigger.rb:26: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/action/warden.rb:50: in `call' from C:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/synced_folders/nfs/action_cleanup.rb:19: in `call' |
Vagrantfile中添加代码 Encoding.default_external = 'UTF-8'
1 2 3 4 5 6 7 8 9 10 11 | Vagrant.configure( "2" ) do |config| # The most common configuration options are documented and commented below. # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. # Every Vagrant development environment requires a box. You can search for # boxes at https://vagrantcloud.com/search. config.vm.box = "centos/7" Encoding.default_external = 'UTF-8' # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)