Herokuのデプロイができない
LaravelのアプリをHerokuでデプロイするのに、下記の手順に従い作業していたのですが、
git push heroku masterのコマンドを打つとエラーが出て正しくデプロイができません。
https://www.hypertextcandy.com/laravel-tutorial-deploy-to-heroku#heroku-%E3%81%A8%E3%81%AF
git push heroku masterを入力したときのエラー文
remote: > @php artisan package:discover --ansi remote: remote: In Auth.php line 56: remote: remote: In order to use the Auth::routes() method, please install the laravel/ui pa remote: ckage. remote: remote: remote: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 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: d71eba1e23ad38860e5339e164d65652be1f6cac remote: ! remote: ! We have detected that you have triggered a build from source code with version d71eba1e23ad38860e5339e164d65652be1f6cac 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 microposterapp. remote: To https://git.heroku.com/microposterapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/microposterapp.git'
### やったこと h3
composer.jsonのconfigに
**"bin-dir": "vender/bin"**を追記した。
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.2.5", "barryvdh/laravel-debugbar": "^3.5", "doctrine/dbal": "^2.11", "fideloper/proxy": "^4.2", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^6.3", "intervention/image": "^2.5", "laravel/framework": "^7.24", "laravel/tinker": "^2.0", "laravelcollective/html": "^6.2" }, "require-dev": { "facade/ignition": "^2.0", "fzaninotto/faker": "^1.9.1", "laravel/ui": "^2.0", "mockery/mockery": "^1.3.1", "nunomaduro/collision": "^4.1", "phpunit/phpunit": "^8.5" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, "bin-dir": "vender/bin" }, "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" ] } }
エラー文を調べてもよくわからなかったので、ヒントをいただけると幸いです。
どうかよろしくお願いいたします。
あなたの回答
tips
プレビュー