Laravel宅基地错误地运行流浪汉

时间:2015-01-25 21:24:10

标签: laravel vagrant homestead

我现在已经成功使用了宅基地大约一个小时,但是当我使用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配置程序采用各种选项。内联或路径之一是   需要

我是否需要在某处传递一些参数?我做错了什么?

提前致谢

这是我的vagrantfile:

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

2 个答案:

答案 0 :(得分:1)

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

请参阅homestead list

答案 1 :(得分:0)

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

在运行homestead up时,Homestead将在MySQL和PostgreSQL服务器中为您创建数据库。

---
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(对于tmux):     $ byobu

并进入项目:     $ cd Projects/jobs

并运行composer:     $ composer update