2

我的 yaml 文件如下所示:

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/VagrantSites/project-base
      to: /home/vagrant/sites/project-base
    - map: ~/VagrantSites/craft-base
      to: /home/vagrant/sites/craft-base

sites:
    - map: local.project-base
      to: /home/vagrant/sites/project-base/public_html
    - map: craft.dev
      to: /home/vagrant/sites/craft-base/public_html

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local
    - key: APP_DEV_MODE
      value: true
    - key: APP_DB_SERVER
      value: localhost
    - key: APP_DB_DATABASE
      value: craft_base
    - key: APP_DB_USER
      value: homestead
    - key: APP_DB_PASSWORD
      value: secret

大概是因为我收到此错误时语法错误:

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.

我尝试删除除第一个变量之外的所有破折号,但根本没有设置任何破折号。

4

2 回答 2

1

我认为您的错误来自使用“真实”一词。在 yaml 中,布尔值应与它们的字符串版本“true”和“false”一起使用。

于 2015-02-04T22:14:13.377 回答
0

作为最佳实践,您最好将环境变量放在项目中,因为将来您可能会有更多项目使用不同的数据库。

对于每个项目,您将设置变量。

来源: http: //laravel.com/docs/4.2/configuration#protecting-sensitive-configuration

于 2015-01-06T03:16:42.493 回答