LoginSignup
0
0

More than 1 year has passed since last update.

Laradock環境におけるClass 'Pusher' not found のエラーについて

Last updated at Posted at 2021-06-10

はじめに

Laradock環境でLaravelアプリに通知機能を付けたい方向けに、タイトルのエラーが生じた場合の対処について記載しました。

Pusherの登録と.envの記述を済ませた後...

laradockディレクトリ下で以下を実行
$ docker-compose exec workspace composer require pusher/pusher-php-server

すると以下の表示が、、、

Fatal error: Allowed memory size of 1610612736 bytes exhausted 略

単純に容量の問題かな?と思い、以下を実行してコンテナ内へ
$ docker-compose exec workspace bash

コンテナに入り、root@xxx:/var/www/html下で以下を実行
$ COMPOSER_MEMORY_LIMIT=-1 composer require pusher/pusher-php-server

しかし上手くいかず何故か
killedで強制的に追い出される、、、

composerコマンドはLaradock下ではなくLaravel下で

ここでlaradock下で実行するのが適切でないのでは?と思い、laravelディレクトリ下で以下を実行
$ composer require pusher/pusher-php-server

すると以下の表示が、、、

Problem 1
    - Root composer.json requires barryvdh/laravel-debugbar ^3.6, found barryvdh/laravel-debugbar[v3.6.0, v3.6.1] but the package is fixed to v3.5.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

どうやらcomposer.lockに記述されているbarryvdh/laravel-debugbaのバージョンがv3.5.7では噛み合わず、v3.6系に変えてくれ、ということらしい。

composer.lockに記述を以下のように書き換えた

"packages-dev": [
        {
            "name": "barryvdh/laravel-debugbar",
            "version": "v3.6.1",         //v3.5.7からv3.6.1へ書き換え
            "source": {
                "type": "git",
                "url": "https://github.com/barryvdh/laravel-debugbar.git",
                //略
            },

結果、以下が通り、Class 'Pusher\Pusher' not foundの問題が解決!!!
$ composer require pusher/pusher-php-server --with-all-dependencies

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0