在 windows 上安装 Vagrant 的问题

     2023-03-23     281

关键词:

【中文标题】在 windows 上安装 Vagrant 的问题【英文标题】:Problem with Vagrant Installation on windows 【发布时间】:2021-10-10 10:34:39 【问题描述】:

我打算使用 homestead 在 Windows 上开发一个 laravel 应用程序。 所以我安装了 VirtualBox,然后又安装了 Vagrant,它按预期进行。 但是当我在命令行上输入 vagrant 并按 Enter 以确保它正常工作时,我看到了这个错误:

Traceback (most recent call last):
        2: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:111:in `<main>'
        1: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- vagrant (LoadError)
        32: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:111:in `<main>'
        31: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:147:in `require'
        30: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `rescue in require'
        29: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `require'
        28: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:338:in `<top (required)>'
        27: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:338:in `each'
        26: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:346:in `block in <top (required)>'
        25: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:346:in `each'
        24: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:329:in `block in <top (required)>'
        23: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant.rb:329:in `load'
        22: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/cloud/plugin.rb:2:in `<top (required)>'
        21: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        20: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        19: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant_cloud-3.0.5/lib/vagrant_cloud.rb:1:in `<top (required)>'
        18: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        17: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        16: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/excon-0.85.0/lib/excon.rb:38:in `<top (required)>'
        15: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        14: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        13: from C:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/excon-0.85.0/lib/excon/socket.rb:2:in `<top (required)>'
        12: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        11: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        10: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:38:in `<top (required)>'
         9: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:168:in `<class:Resolv>'
         8: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:171:in `<class:Hosts>'
         7: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         6: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         5: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/resolv.rb:7:in `<top (required)>'
         4: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         3: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
         2: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:4:in `<top (required)>'
         1: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:72:in `<module:Win32>'
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:72:in `find': unknown encoding name - CP720 (ArgumentError)

我已经安装了 VirtualBox 6.1.26 和 Vagrant 2.2.18 64 位。我的 Windows 上启用了虚拟化。我也禁用了hyper-v。 有没有人知道哪里错了?

【问题讨论】:

#reza @reza 请指定应用程序版本,例如虚拟盒子版本 e.t.c @peter 我编辑了这个问题。谢谢。 从 2.2.18 的 6.1.26 vagrant 2.0.0 将应用程序版本降低到虚拟框 5.1.26 @peter 我想使用最新版本的 laravel,它需要 VirtualBox 6.1.x @peter 我刚刚安装了 vagrant 2.0.0 并且成功了!谢谢彼得 【参考方案1】:

解决方案#1

降低应用版本 从 6.1.26 到虚拟盒子 5.1.26 和 vagrant 2.0.0 来自 2.2.18

解决方案#2

重新安装应用

【讨论】:

这在 Windows 10 上不起作用,当您尝试运行虚拟框管理器时,它只会抛出此应用程序无法启动的消息,因为它会导致 Windows 上的安全和性能问题

windows下vagrant的安装使用

vagrant是简便虚拟机操作的一个软件,而使用虚拟机是为了开发环境与生产环境一致(很多开发环境为windows而生产环境为linux),不至于出现在开发环境正常而移步到正式生产环境时出现各种问题,vagrant通过共享文件,可以实现... 查看详情

如何在没有 nfs 的 Vagrant 上运行 Symfony2 应用程序(例如在 Windows 上)?

】如何在没有nfs的Vagrant上运行Symfony2应用程序(例如在Windows上)?【英文标题】:HowtorunSymfony2applicationonVagrantwithoutnfs(onWindows,forexample)?【发布时间】:2014-12-1011:14:00【问题描述】:在Vagrant/Windows上使用默认设置运行Symfony2应用程... 查看详情

在带有 Vagrant 的 Windows 上使用 NFS 时 Apache 无响应

】在带有Vagrant的Windows上使用NFS时Apache无响应【英文标题】:ApacheunresponsivewhenusingNFSonWindowswithVagrant【发布时间】:2020-12-1709:38:45【问题描述】:我正在使用LaravelHomestead(Vagrant)来设置我的开发环境。一切正常,直到我按照https://la... 查看详情

vagrant/homestead/windows 上的 npm 安装错误:EPROTO:协议错误,符号链接

】vagrant/homestead/windows上的npm安装错误:EPROTO:协议错误,符号链接【英文标题】:npminstallerrorsonvagrant/homestead/windows:EPROTO:protocolerror,symlink【发布时间】:2016-01-1603:07:15【问题描述】:我正在Laravel中构建我的第一个项目并尝试使... 查看详情

在 Windows 7 主机上使用活动 *** 连接启动时,vagrant 配置的 virtualbox 无法访问互联网

】在Windows7主机上使用活动***连接启动时,vagrant配置的virtualbox无法访问互联网【英文标题】:vagrantprovisionedvirtualboxcannotaccesstheinternetwhenbootedupwithanactive***connectiononthewindows7host【发布时间】:2015-04-0403:02:48【问题描述】:我在设... 查看详情

获取在 Vagrant VM 上运行的 LAMP 堆栈(在 Windows 7 主机下),完整说明?

】获取在VagrantVM上运行的LAMP堆栈(在Windows7主机下),完整说明?【英文标题】:GettingaLAMPstackrunningonaVagrantVM(underWindows7host),fullinstructions?【发布时间】:2013-01-1413:21:10【问题描述】:我有一个VagrantVM标准问题lucid32.box正在运行。... 查看详情

在 Windows10 上打开/创建内网 Vagrant 失败

】在Windows10上打开/创建内网Vagrant失败【英文标题】:Failedtoopen/createtheinternalnetworkVagrantonWindows10【发布时间】:2016-02-1623:38:01【问题描述】:我昨天将我的Windows10升级到了最后一次更新,现在,当我启动vagrantup命令时,我收到了... 查看详情

vagrant在windows下的安装和配置(代码片段)

记录一下安装和配置过程中的一些坑步骤一分别下载vagrant和VirtualBox,我这里下载的是vagrant_1.9.1.msi和VirtualBox-5.1.14-112924-Win.exe步骤二这两个东东安装好之后,我在e盘创建了一个myvagrant目录,作为工程目录,进入该目录,进行添... 查看详情

从 Windows 系统中删除 Homestead 和 Vagrant 的最干净的方法是啥?

】从Windows系统中删除Homestead和Vagrant的最干净的方法是啥?【英文标题】:What\'sthecleanestwaytoremoveHomesteadandVagrantfromaWindowssystem?从Windows系统中删除Homestead和Vagrant的最干净的方法是什么?【发布时间】:2015-01-1922:38:07【问题描述】... 查看详情

git commit -am "Commit message" 不能在 vagrant 机器上正常工作

】gitcommit-am"Commitmessage"不能在vagrant机器上正常工作【英文标题】:gitcommit-am"Commitmessage"doesn\'tworkproperlywithvagrantmachine【发布时间】:2018-10-1809:00:50【问题描述】:我在Windows7中使用GitBash。对于我的项目,我在Windows... 查看详情

vagrant搭建虚拟化开发环境初识(代码片段)

Vagrant简介  Vagrant是一款用来构建虚拟开发环境的工具,它是用来管理虚拟机的,同时也非常适合php/python/ruby/java这类语言开发web应用,“代码在我机子上运行没有问题”这种说辞将成为历史。我们可以通过Vagrant封装一个Linux... 查看详情

vagrant-安装教程及常见问题(代码片段)

前言:Vagrant是一个基于Ruby的工具,用于创建和部署虚拟化开发环境。它的主要意义是让所有开发人员都使用和线上服务器一样的环境,本质上和你新建一个虚拟机。 那最常见的,正常我们是怎么开发呢,大... 查看详情

基于virtualbox和vagrant搭建虚拟机(代码片段)

一、VirtualBox和vagrant的安装VirtualBox是一款开源的虚拟机软件,和VMWare是同类型的软件,用于在当前的电脑上构建一台虚拟机,在这台虚拟机上可以安装系统和软件,与真实的电脑一般无二。Vagrant用于创建和部署虚拟化开发环境... 查看详情

在windows上通过vagrant练习ansible

有点曲折,但没办法,还要通过VAGRANT里的ANSIBLE建DOCKER呢。。VagrantFile#-*-mode:ruby-*-#vi:setft=ruby:Vagrant.configure(2)do|config|config.vm.box="ubuntu/trusty64"if(/cygwin|mswin|mingw|bccwin|wince|emx/=~RUBY_PLATFORM)! 查看详情

使用 Vagrant 配置 Windows VM 无法执行远程 WinRM 命令

】使用Vagrant配置WindowsVM无法执行远程WinRM命令【英文标题】:ProvisioningWindowsVMwithVagrantcannotexecuteremoteWinRMcommands【发布时间】:2021-11-2714:37:12【问题描述】:我正在尝试在现有的Vagrant机器上安装一些基本工具,但我的shell命令失... 查看详情

Cygwin 上 Vagrant 中的 Puphpet MySQL 工作台连接

】Cygwin上Vagrant中的PuphpetMySQL工作台连接【英文标题】:PuphpetMySQLWorkbenchConnectioninVagrantonCygwin【发布时间】:2016-03-1504:07:09【问题描述】:我是编程新手,对端口/转发/连接等不太了解。在Windows8.1上安装Vagrant、MySQLWorkbench和Cygwin... 查看详情

vagrant怎么打开virtualbox

...前的经验《教你windows7获取安装指定版本VirtualBox》*虽然Vagrant也支持VMware,不过VMware是收费的,对应的Vagrant版本也是收费的安装Vagrant下载Vagrant最新笨笨根据提示一步步安装;安装包的获取和安装过程可以参考我的经验《一步一... 查看详情

怎么使用vagrant的box

...前的经验《教你windows7获取安装指定版本VirtualBox》*虽然Vagrant也支持VMware,不过VMware是收费的,对应的Vagrant版本也是收费的安装Vagrant下载Vagrant最新笨笨根据提示一步步安装;安装包的获取和安装过程可以参考我的经验《一步一... 查看详情