第一次在Heroku上部署Laravel 5.7时出错

里卡多·阿尔贝克(Ricardo Albear)

我重新安装了Laravel 5.7,尝试在Heroku中部署它时出现错误。我还在Heroku设置中设置了APP-KEY值和heroku/phpBuildpak。

有什么想法吗?

构建日志:

-----> 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/

composer.json,因为之前的额外错误,我将其添加"laravel/dusk"到extra-> laravel-> dont-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安装带有一个bootstrap/cache/.gitignore文件它的存在(和内容)的程序存储库确保目录存在的部署,但没有别的该目录中的源代码控制卷起。

您收到的错误表明您没有将其检入到存储库中(或由于某种原因将其删除了)。签入它应该清除消息,因为该文件夹将存在,供您的应用写入。

还有其他一些实例,例如storage/logs,的各种子文件夹storage/framework等。如果在这些目录中收到类似的错误,则将应用相同的修复程序。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章