% heroku buildpacks:set heroku/php
% heroku buildpacks:set heroku/nodejs
//それぞれ以下のようなメッセージが出ればOK(以下はheroku/php導入時の例)
Buildpack set. Next release on example-app will use heroku/php.
Run git push heroku main to create a new release using this buildpack.
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
//デフォルトの言語が設定されていません
remote: ! No default language could be detected for this app.
//ヒント:この問題は、Herokuがこのアプリに使うべきbuildpackを自動的に検出できない時に発生します
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to example-app.
// このビルドパックではサポートされていないアプリです!
ERROR: Application not supported by this buildpack!
remote: !
// phpのビルドパックをセットしてますがphpのアプリじゃないと思います。
remote: ! The 'heroku/php' buildpack is set on this application, but was
remote: ! unable to detect a PHP codebase.
remote: !
// phpのアプリだったらcomposer.jsonがルートディレクトリにある構造か、古いものならindex.phpが必要です。
remote: ! A PHP app on Heroku requires a 'composer.json' at the root of
remote: ! the directory structure, or an 'index.php' for legacy behavior.
remote: !
// もしphpのアプリとしてデプロイしたいなら、ディレクトリのトップレベルを確認してください。
remote: ! If you are trying to deploy a PHP application, ensure that one
remote: ! of these files is present at the top level directory.
remote: !
// もし違う言語で書かれたアプリなら、適切なビルドパックを使ってください。
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
エラー3:WARNING: A post-autoload-dump script terminated with an error
// post-autoload-dumpスクリプトがエラーにより終了しました。
remote: ! WARNING: A post-autoload-dump script terminated with an error
remote:
// 依存関係のインストールの失敗です!
remote: ! ERROR: Dependency installation failed!
remote: !
// 'composer install'プロセスが失敗しました。原因はおそらく'composer.json'における、ダウンロードか、パッケージのインストールか、事前/事後インストールのフックによるものです
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.
% heroku addons:create jawsdb:kitefin --version=8.0
Creating jawsdb:kitefin on ⬢ example-app... free
Database is being provisioned. Your config_var will be set automatically once available.
Created * as JAWSDB_URL
Use heroku addons:docs jawsdb to view documentation
うまくいったら以下のコマンドでアドオンがちゃんと追加されているか確認します。
% heroku addons
Add-on Plan Price State
───────────────────────────────── ─────── ───── ───────
jawsdb (*) kitefin free created
└─ as JAWSDB
The table above shows add-ons and the attachments to the current app (example-app) or other apps.
※ちなみにクレカ未登録でJawsDBを導入しようとすると以下のように怒られます。
% heroku addons:create jawsdb:kitefin --version=8.0
Creating jawsdb:kitefin on ⬢ example-app... !
▸ Please verify your account to install this add-on plan (please enter a credit card) For more information, see https://devcenter.heroku.com/categories/billing Verify now at
▸ https://heroku.com/verify
% heroku run php artisan migrate
Running php artisan migrate on ⬢ example-app... up, run.9658 (Free)
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? (yes/no) [no]:
> yes
Migration table created successfully.
Migrating: ...
〜以下略〜