vagrant 创建 add laravel 报错

发布于 2022-09-07 12:25:21 字数 5668 浏览 60 评论 0

我在win10 系统想要安装homestead来运行laravel,但是刚安装好,第一步
vagrant box add laravel/homestead
这个代码就报错了

错误内容:

PS C:WINDOWSsystem32> vagrant box list
laravel/homestead (hyperv, 5.2.0)
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:208:in `initialize': Malformed version number string ~ (ArgumentError)

    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:199:in `new'
    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:199:in `new'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:289:in `block (2 levels) in find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:285:in `map'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:285:in `block in find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:448:in `block in with_collection_lock'
    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:447:in `with_collection_lock'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:271:in `find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/list.rb:54:in `block in list_boxes'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/list.rb:47:in `each'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/list.rb:47:in `list_boxes'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/list.rb:30:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/root.rb:66:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/cli.rb:54:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/environment.rb:275:in `cli'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/bin/vagrant:156:in `<main>'

PS C:WINDOWSsystem32>

还有:
PS F:Server> vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'

box: URL: https://vagrantcloud.com/laravel/homestead

This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) parallels
2) virtualbox
3) vmware_desktop

Enter your choice: 2
==> box: Adding box 'laravel/homestead' (v6.1.0) for provider: virtualbox
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:208:in `initialize': Malformed version number string ~ (ArgumentError)

    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:199:in `new'
    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/version.rb:199:in `new'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:289:in `block (2 levels) in find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:285:in `map'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:285:in `block in find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:448:in `block in with_collection_lock'
    from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:447:in `with_collection_lock'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/box_collection.rb:271:in `find'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/builtin/box_add.rb:315:in `box_add'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/builtin/box_add.rb:283:in `add_from_metadata'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/builtin/box_add.rb:118:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/builder.rb:116:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/runner.rb:66:in `block in run'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/busy.rb:19:in `busy'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/runner.rb:66:in `run'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/add.rb:78:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/commands/box/command/root.rb:66:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/cli.rb:54:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/environment.rb:275:in `cli'
    from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/bin/vagrant:156:in `<main>'

PS F:Server>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2022-09-14 12:25:21

https://laravel-china.org/doc...

根据这个文档 , 用离线的box安装 5分钟搞定~ 望采纳

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文