前提・実現したいこと
git push heroku master のコマンド実行時にエラーが生じました。
これを解決したいです。
https://www.hypertextcandy.com/laravel-tutorial-deploy-to-heroku
これが参考にしたサイトです。
発生している問題・エラーメッセージ
remote: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255 remote: ! WARNING: A post-autoload-dump script terminated with an error remote: remote: ! ERROR: Dependency installation failed! remote: ! remote: ! The 'composer install' process failed with an error. The cause remote: ! may be the download or installation of packages, or a pre- or remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts') remote: ! in your 'composer.json'. remote: ! remote: ! Typical error cases are out-of-date or missing parts of code, remote: ! timeouts when making external connections, or memory limits. remote: ! remote: ! Check the above error output closely to determine the cause of remote: ! the problem, ensure the code you're pushing is functioning remote: ! properly, and that all local changes are committed correctly. remote: ! remote: ! For more information on builds for PHP on Heroku, refer to remote: ! https://devcenter.heroku.com/articles/php-support remote: ! remote: ! REMINDER: the following warnings were emitted during the build; remote: ! check the details above, as they may be related to this error: remote: ! - A post-autoload-dump script terminated with an error remote: remote: ! Push rejected, failed to compile PHP app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: 747f19d95313c0e21daaf2ea9a981e2cd65d37ad remote: ! remote: ! We have detected that you have triggered a build from source code with version 747f19d95313c0e21daaf2ea9a981e2cd65d37ad remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to damp-fjord-29872. remote: To https://git.heroku.com/damp-fjord-29872.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-fjord-29872.git'
composer.json
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.2.5|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^6.3.1|^7.0.1", "laravel/framework": "^7.29", "laravel/tinker": "^2.5", "laravel/ui": "2.5" }, "require-dev": { "facade/ignition": "^2.0", "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.3.1", "nunomaduro/collision": "^4.3", "phpunit/phpunit": "^8.5.8|^9.3.3" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "extra": { "laravel": { "dont-discover": [] } }, "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" ] } }
試したこと
このエラーコードについて調べたらいろんな記事が出てきたんですが、どの記事も解決できなかったので、質問しました。
ためしたサイト
https://stackoverflow.com/questions/64456175/a-post-autoload-dump-script-terminated-with-an-error
https://teratail.com/questions/175530
https://www.webune.com/forums/axpxyr.html
https://teratail.com/questions/175530
https://qiita.com/gotokoki1/items/788f97b18dfe9ab78d1c
https://www.fixes.pub/program/254687.html
補足情報(FW/ツールのバージョンなど)
PHP 7.4.26
laravel 7.30.1
virtualbox バージョン 6.1.28
centos-8
laravel/ui 2.5
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/12/18 15:23 編集