質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Q&A

0回答

393閲覧

LaravelアプリのHerokuへのデプロイ時のエラー

sakuma-s

総合スコア4

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

0グッド

0クリップ

投稿2020/10/20 06:56

編集2020/10/20 07:28

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" ] } }

エラー文を調べてもよくわからなかったので、ヒントをいただけると幸いです。
どうかよろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問