こんにちは。初めての質問になります。現在オリジナルアプリをlaravelで作成していこうと考えているど素人のものです。
本番環境で確認しながらこれから作成を進めていきたいのですが、最初のデプロイでつまづいています。
Herokuでデプロイしようと思っているのですが、エラー画面が以下のように出てしまい先に進めなくなりました。どなたかご教授いただけると助かります。
以下、最後のコマンドをターミナルで打った後のエラーです。
$ heroku create babyfood-36690 --buildpack heroku/php
$ git init
$ heroku git:remote -a <babyfood-36690>
$ git push heroku master ←ここでエラーが出ました
なお、GitHub Desktopにて最新の状態にcommit、pushしています。
以下、エラー文です。
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: f8ed148f199528e408627b03f543d4b50bdd0ba0
remote: !
remote: ! We have detected that you have triggered a build from source code with version f8ed148f199528e408627b03f543d4b50bdd0ba0
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 babyfood-36690.
remote:
To https://git.heroku.com/babyfood-36690.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/babyfood-36690.git'
色々と調べていて、.gitignoreやcomposer.jsonあたりが関連してきそうなので、載せておきます。
.gitignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
composer.json
lang
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.2.5|^8.0", "barryvdh/laravel-debugbar": "^3.6", "fideloper/proxy": "^4.4", "laravel/framework": "^6.20.26", "laravel/tinker": "^2.5" }, "require-dev": { "facade/ignition": "^1.16.15", "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.0", "nunomaduro/collision": "^3.0", "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" ] } }
また、Laravelをインストールしてから変更した内容は
・タイムゾーン/言語設定
・データベースの文字コード
・デバッグバーのインストール
・データベース設定(ローカル環境)となります
情報として追加したほうがよろしければ、アドバイスをお願いいたします。
Laravel を8ではなく6を使っているため、Herokuとうまく連動してくれないのかもしれないと思ったりもします。
一通り調べてみて手詰まりとなってしまったので、アドバイスをよろしくお願いいたします。
まだ回答がついていません
会員登録して回答してみよう