【问题标题】:vagrant up command issuevagrant up 命令问题
【发布时间】:2022-02-18 02:52:50
【问题描述】:

我是 Vagrant 的新手。我的主管希望我经营一个网站。首先他告诉我安装 VirtualBox 和 Vagrant。他给我发了 bootstrap.sh 和 Vagrantfile 文件。他告诉我把它复制到一个名为“data_repo”的文件夹中。之后他告诉我从“data_repo”运行“vagrant up”命令。我这样做了,但它给了我以下错误:

A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

您能告诉我解决方法吗?

【问题讨论】:

  • 你能把 bootstrap.sh 和 Vagrantfile 的内容贴出来吗?
  • 您不能在data_repo 目录中或Vagrantfile 不存在。我认为最好的方法是去和你的主管谈谈,向他寻求一点支持
  • 阅读文档总是有帮助的。 vagrantup.com/docs/getting-started

标签: vagrant virtualbox vagrantfile vagrant-plugin


【解决方案1】:

我在 Windows 机器上遇到了同样的问题,我用这种方法解决了它:将文件 Vagrantfile.txt 重命名为 Vagrantfile(不带 .txt)。

【讨论】:

    【解决方案2】:

    我在 linux 系统上遇到了同样的问题。我错误地删除了 Vagrantfile 文件。

    【讨论】:

      【解决方案3】:

      应该只有一个 Vagrantfile。 确保该文件夹(data_repo)中有 Vagrantfile(V 大写且无扩展名)。

      按照此处的文档进行操作

      https://www.vagrantup.com/docs/getting-started/

      【讨论】:

        【解决方案4】:

        我遇到了同样的问题,只是意识到文件名Vagrantfile 中有一个尾随空格。只需将其删除即可使其正常工作。

        【讨论】:

          猜你喜欢
          • 2023-03-28
          • 2023-03-17
          • 1970-01-01
          • 1970-01-01
          • 2022-01-05
          • 2015-01-29
          • 1970-01-01
          • 1970-01-01
          • 2020-03-01
          相关资源
          最近更新 更多