【问题标题】:Laravel 5.2 Heroku Deployment Failed to install system packagesLaravel 5.2 Heroku 部署安装系统包失败
【发布时间】:2018-04-01 02:08:09
【问题描述】:

我正在尝试将 Laravel 5.2 项目部署到 heroku,但出现以下错误

-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
!     ERROR: Failed to install system packages.

   Your platform requirements (for runtimes and extensions) could
   not be resolved to an installable set of dependencies, or a
   repository was unreachable.

   Full error information from installation attempt:

   > Loading repositories with available runtimes and extensions
   > 
   > Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
   > Nothing to install or update
   > Generating autoload files

   Please verify that all requirements for runtime versions in
   'composer.lock' are compatible with the list below, and ensure
   all required extensions are available for the desired runtimes.

   For reference, the following runtimes are currently available:

   PHP:  7.1.10, 7.1.9, 7.1.8, 7.1.3, 7.1.2, 7.1.1, 7.0.24, 
   7.0.23, 7.0.22, 7.0.17, 7.0.16, 7.0.15, 5.6.31, 5.6.30, 
   5.5.38
   HHVM: 3.5.1

   For a list of supported runtimes & extensions on Heroku, please
   refer to: https://devcenter.heroku.com/articles/php-support
!     Push rejected, failed to compile PHP app.
!     Push failed

这是我的 composer.json 文件

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "barryvdh/laravel-ide-helper": "^2.1",
        "components/jquery": "2.1.4",
        "components/jqueryui": "1.11.4",
        "kodeine/laravel-acl": "^0.1.3",
        "laravelcollective/html": "5.2.*"
    },
    "require-dev": {
        "symfony/dom-crawler": "~3.0",
        "symfony/css-selector": "~3.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

在使用 composer install、composer update、composer update --lock 之后,我尝试部署了大约几十次,我什至删除了 composer.lock 文件并再次运行 composer update,但这个错误并没有消失。请帮忙!

【问题讨论】:

  • 您能开一张支持票吗?看起来平台安装步骤存在一个锁定文件。没有任何情况下应该是这种情况。一定是虫子,凭票,我可以调查。谢谢!

标签: php heroku laravel-5.2 composer-php


【解决方案1】:

事实证明,我的供应商文件夹未列在 .gitignore 文件中,它与 heroku 上的其他文件一起被推送。一旦我将供应商文件夹添加到.gitignore,一切都开始无缝运行。

【讨论】:

    猜你喜欢
    • 2020-11-02
    • 2019-05-18
    • 2017-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-08
    相关资源
    最近更新 更多