1

我正在尝试将 Laravel 4.2 站点从 Forge 转换为 Forge/Envoyer。我正在关注 laracast,但我不断收到错误消息:

PHP 致命错误:在第 157 行的 /home/forge/Site/envoyer/releases/20150511192402/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php 中找不到类 'Way\Generators\GeneratorsServiceProvider'

在 Envoyer 部署的 Install Composer Dependencies 步骤中。

我已经从两者中删除了 Way/Generators 的行,composer.jsonconfig/app.php按照文档重新安装它。Envoyer 在移除 Way/Generators 的情况下工作,但当我重新添加它时仍然失败。

有人对如何解决它有任何想法吗?

4

1 回答 1

4

在 composer.json 添加 way/generators 里面的“require-dev”,所以它只会被下载到你的开发机器上。

"require-dev": {
    "way/generators": "~2.0"
}

Way\Generators\GeneratorsServiceProvider仅在本地(开发)配置中添加- config/local/app.php. 这样它就会出现在您的开发机器上,因为它将使用config/local/app.php,但在部署时,特使将使用config/app.php,其中Way\Generators\GeneratorsServiceProvider未设置。

这就是你的config/local/app.php样子:

<?php

return array(
    'debug' => true,
    'providers' => append_config(array(
        'Way\Generators\GeneratorsServiceProvider'
    ))
);
于 2015-05-12T07:59:30.683 回答