Laravel 5.2 Heroku部署无法安装系统软件包

时间:2017-10-19 22:50:31

标签: php heroku laravel-5.2 composer-php

我正在尝试将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但是这个错误不会发生在任何地方。请帮忙!

1 个答案:

答案 0 :(得分:0)

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