我如何让 Vagrant 找到最新的(宅基地)盒子

How do I get Vagrant to find the latest (homestead) box

我有最新版本的vagrant,我通过[=14=添加了一个homestead框,我通过[=22=从github查看了最新的homestead ]

git clone https://github.com/laravel/homestead.git homestead
cd homestead
git checkout release

但是当我执行 vagrant up 时,它找不到 v10.1.1 框并尝试下载 v9.7.2

>vagrant -v
Vagrant 2.2.14

>vagrant box update
==> homestead: Checking for updates to 'laravel/homestead'
    homestead: Latest installed version: 10.1.1
    homestead: Version constraints: ~> 9
    homestead: Provider: virtualbox
==> homestead: Box 'laravel/homestead' (v10.1.1) is running the latest version.

>vagrant box list
laravel/homestead  (virtualbox, 10.1.1)
>vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: [vagrant-hostsupdater] Checking for host entries
==> homestead: [vagrant-hostsupdater]   found entry for: 192.168.10.10 homestead
==> homestead: [vagrant-hostsupdater]   found entry for: 192.168.10.10 laravel.test
==> homestead: Box 'laravel/homestead' could not be found. Attempting to find and install...
    homestead: Box Provider: virtualbox
    homestead: Box Version: ~> 9
==> homestead: Loading metadata for box 'laravel/homestead'
    homestead: URL: https://vagrantcloud.com/laravel/homestead
==> homestead: Adding box 'laravel/homestead' (v9.7.2) for provider: virtualbox
    homestead: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.7.2/providers/virtualbox.box
==> homestead: Box download is resuming from prior download progress

我看到我可以在我的 Homestead.yaml 中使用 version: 10.1.1 但为什么 vagrant 试图获得 v9 而不是使用我拥有的 v10?

laravel/homstead 项目中的默认设置使用版本 9。 所以你必须在 /Users/(name)/Homestead/scripts/homestead.rb

中修改以下设置
config.vm.box_version = settings['version'] ||= '‍‍‍‍‍~> 9'

config.vm.box_version = settings['version'] ||= '‍‍‍‍‍>= 10.1.1'

保存更改后,您可以启动框:

vagrant up