首次在Heroku上部署Laravel 5.7时出错

首次在Heroku上部署Laravel 5.7时出错,laravel,heroku,Laravel,Heroku,我有一个新安装的Laravel5.7,当我试图在Heroku中部署它时,我得到了一个错误。我还在heroku设置中设置了APP-KEY值和heroku/phpBuildpak 你知道发生了什么事吗 生成日志: -----> PHP app detected -----> Bootstrapping... -----> Installing platform packages... - php (7.3.1) - ext-mbstring (bundl

我有一个新安装的Laravel5.7,当我试图在Heroku中部署它时,我得到了一个错误。我还在heroku设置中设置了
APP-KEY
值和
heroku/php
Buildpak

你知道发生了什么事吗

生成日志:

-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
       - php (7.3.1)
       - ext-mbstring (bundled with php)
       - apache (2.4.37)
       - nginx (1.8.1)
-----> Installing dependencies...
       Composer version 1.8.0 2018-12-03 10:31:16
       Loading composer repositories with package information
       Installing dependencies from lock file
       Package operations: 53 installs, 0 updates, 0 removals
         - Installing doctrine/inflector (v1.3.0): Downloading (100%)
         - Installing doctrine/lexer (v1.0.1): Downloading (100%)
         - Installing dragonmantank/cron-expression (v2.2.0): Downloading (100%)
         - Installing erusev/parsedown (1.7.1): Downloading (100%)
         - Installing vlucas/phpdotenv (v2.5.2): Downloading (100%)
         - Installing symfony/css-selector (v4.2.2): Downloading (100%)
         - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Downloading (100%)
         - Installing symfony/polyfill-php72 (v1.10.0): Downloading (100%)
         - Installing symfony/polyfill-mbstring (v1.10.0): Downloading (100%)
         - Installing symfony/var-dumper (v4.2.2): Downloading (100%)
         - Installing symfony/routing (v4.2.2): Downloading (100%)
         - Installing symfony/process (v4.2.2): Downloading (100%)
         - Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%)
         - Installing symfony/http-foundation (v4.2.2): Downloading (100%)
         - Installing symfony/contracts (v1.0.2): Downloading (100%)
         - Installing symfony/event-dispatcher (v4.2.2): Downloading (100%)
         - Installing psr/log (1.1.0): Downloading (100%)
         - Installing symfony/debug (v4.2.2): Downloading (100%)
         - Installing symfony/http-kernel (v4.2.2): Downloading (100%)
         - Installing symfony/finder (v4.2.2): Downloading (100%)
         - Installing symfony/console (v4.2.2): Downloading (100%)
         - Installing egulias/email-validator (2.1.7): Downloading (100%)
         - Installing swiftmailer/swiftmailer (v6.1.3): Downloading (100%)
         - Installing paragonie/random_compat (v9.99.99): Downloading (100%)
         - Installing ramsey/uuid (3.8.0): Downloading (100%)
         - Installing psr/simple-cache (1.0.1): Downloading (100%)
         - Installing psr/container (1.0.0): Downloading (100%)
         - Installing opis/closure (3.1.5): Downloading (100%)
         - Installing symfony/translation (v4.2.2): Downloading (100%)
         - Installing nesbot/carbon (1.36.2): Downloading (100%)
         - Installing monolog/monolog (1.24.0): Downloading (100%)
         - Installing league/flysystem (1.0.49): Downloading (100%)
         - Installing ralouphie/getallheaders (2.0.5): Downloading (100%)
         - Installing psr/http-message (1.0.1): Downloading (100%)
         - Installing guzzlehttp/psr7 (1.5.2): Downloading (100%)
         - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
         - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)
         - Installing laravel/slack-notification-channel (v1.0.3): Downloading (100%)
         - Installing zendframework/zend-diactoros (1.8.6): Downloading (100%)
         - Installing php-http/promise (v1.0.0): Downloading (100%)
         - Installing php-http/httplug (v1.1.0): Downloading (100%)
         - Installing php-http/guzzle6-adapter (v1.1.1): Downloading (100%)
         - Installing lcobucci/jwt (3.2.5): Downloading (100%)
         - Installing nexmo/client (1.6.1): Downloading (100%)
         - Installing laravel/nexmo-notification-channel (v1.0.1): Downloading (100%)
         - Installing laravel/framework (v5.7.22): Downloading (100%)
         - Installing fideloper/proxy (4.1.0): Downloading (100%)
         - Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
         - Installing nikic/php-parser (v4.2.0): Downloading (100%)
         - Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
         - Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%)
         - Installing psy/psysh (v0.9.9): Downloading (100%)
         - Installing laravel/tinker (v1.0.8): Downloading (100%)
       Generating optimized autoload files
       > Illuminate\Foundation\ComposerScripts::postAutoloadDump
       > @php artisan package:discover --ansi

       In PackageManifest.php line 168:

         The /tmp/build_73d13e43929228fd562bd9df625e545c/bootstrap/cache directory m  
         ust be present and writable.                                                 


       Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
 !     WARNING: A post-autoload-dump script terminated with an error
 !     ERROR: Dependency installation failed!
 !     
 !     The 'composer install' process failed with an error. The cause
 !     may be the download or installation of packages, or a pre- or
 !     post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
 !     in your 'composer.json'.
 !     
 !     Typical error cases are out-of-date or missing parts of code,
 !     timeouts when making external connections, or memory limits.
 !     
 !     Check the above error output closely to determine the cause of
 !     the problem, ensure the code you're pushing is functioning
 !     properly, and that all local changes are committed correctly.
 !     
 !     For more information on builds for PHP on Heroku, refer to
 !     https://devcenter.heroku.com/articles/php-support
 !     
 !     REMINDER: the following warnings were emitted during the build;
 !     check the details above, as they may be related to this error:
 !     - A post-autoload-dump script terminated with an error
 !     Push rejected, failed to compile PHP app.
 !     Push failed
程序文件:

web: vendor/bin/heroku-php-apache2 public/
json,因为前面的一个额外错误,我将
“laravel/dash”
添加到extra->laravel->not discover

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/dusk"
            ]
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

全新的Laravel安装随附。它在respository中的存在(和内容)确保了该目录存在于部署中,但该目录中的任何其他内容都不会在源代码管理中结束

您收到的错误表明您没有将其签入存储库(或出于某种原因将其删除)。签入该文件夹会清除邮件,因为该文件夹将存在,您的应用程序可以将其写入


还有其他几种情况,如
storage/logs
storage/framework
的各种子文件夹等。如果在这些目录中收到类似错误,同样的修复也适用。

请确保该文件存在并且是存储库的一部分。@deejayoz,这是有效的!如果您将其设置为解决方案,我会将其标记为解决方案:)我强制将缓存文件夹添加到repo中,从而使其工作!