0

我已经成功使用宅基地大约一个小时了,但是当我暂停我的虚拟机vagrant suspend并尝试使用它再次启动它时,vagrant up我得到了这个错误:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

shell provisioner:
* Shell provisioner `args` must be a string or array.

这是什么意思?流浪者文档说

shell 配置器有多种选择。需要内联或路径之一

我需要在某处传递一些参数吗?我究竟做错了什么?

提前致谢

这是我的流浪文件:

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"

homesteadYamlPath = File.expand_path("~/.homestead/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")

require_relative 'scripts/homestead.rb'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exists? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
    end

    Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))

    if File.exists? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath
    end
end
4

2 回答 2

1

如果这是宅基地 2,您需要使用homestead uphomestead suspend

homestead list

于 2015-01-26T10:36:09.423 回答
0

这是我的~/homestead/.Homestead.yaml文件,它包含两个应用程序的配置,一个启用了 HHVM,一个禁用了 HHVM(宅基地默认)。

当运行homestead up.

---
ip: "192.168.10.10"
memory: 2048
cpus: 1

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Projects
      to: /home/vagrant/Projects

sites:
    - map: jobs.app
      to: /home/vagrant/Projects/jobs/public
    - map: messages.app
      to: /home/vagrant/Projects/messages/web
      hhvm: true

databases:
    - jobs
    - messages

variables:
    - key: APP_ENV
      value: local

您现在可以运行:$homestead up

然后:$homestead ssh

然后运行 ​​byobu(for tmux): $byobu

并 cd 进入项目:$cd Projects/jobs

并运行作曲家:$composer update

于 2015-01-27T19:45:11.220 回答