ubuntu - 为什么我在这个 Vagrantfile 中出现语法错误
问题描述
我刚开始学习如何使用 Vagrant!因此,当我尝试在 Vagrant 中迈出第一步时,我正在尝试使用“vagrant up”创建一个 vagrant 环境,但我的 Vagrantfile 出现语法错误。这是流浪文件:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Always use Vagrant's default insecure key
config.ssh.insert_key = false
# Always use X11 Forwarding with r+this machine
config.ssh.forward_x11 = true
# To avoid/allow install and uninstall of VBoxGuessAdditions.
config.vbguest.auto_update = false
# Disable/enable automatic box update checking.
config.vm.box_check_update = false
# Assign a friendly name for vagrant STATUS
config.vm.define "mininet" do |mininet_config|
# Every Vagrant development environment requires a box.
mininet_config.vm.box = "ktr/mininet"
# Assign a friendly name to this host VM
mininet_config.vm.hostname = "mininet"
# Create a private network, which allows host-only access to the machine
mininet_config.vm.network "private_network", ip: "192.168.56.11"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant.
# Example for VirtualBox:
mininet_config.vm.provider "virtualbox" do |vb|
# Change the VM name/ID in the Hypervisor
vb.name = "mininet"
opts = ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize opts
end
end
# Some shell provisioning when machine is launched
config.vm.provision "shell", :inline "apt-get update --fix-missing"
end
这是来自终端的警告:
syntax error, unexpected tSTRING_BEG, expecting keyword_end
m.provision "shell", :inline "apt-get update --fix-missing"
^
/home/alexandre/Desktop/3ano/RC/lab1/RC/mininet-updated/Vagrantfile:38: syntax error, unexpected keyword_end, expecting end-of-input
如果有人可以帮助我解决这个问题,我将不胜感激。谢谢你的时间
解决方案
推荐阅读
- azure - Rust 应用程序如何将云到设备的消息发送到 IoTHub 以到达设备?
- json - 如何在 PostgreSQL 中删除 jsonb 整数数组中的元素
- google-colaboratory - 如何将 Colab 中生成的文件直接下载到 Dropbox?
- swift - 使用通用参数调用函数需要类型的无参数初始化
- python - 如何使 gremlin_python DriverRemoteConnection 每次提交都有超时和重试限制?
- ios - 构建命令 react-native run-ios 时出错
- oracle - 需要使用 REGEXP_SUBSTR 提取文本 - 找不到正确的组合
- r - R将CDF列添加到DataFrame
- c# - 部署到 Azure 时,Blazor 服务器使用 HTML 而不是 JSON 进行响应
- google-meet - 在离开页面之前让 Google Meet 确认?