Laravelのデプロイ時にPlease provide a valid cache path.が出た時の対処法

LaravelError
この記事は約2分で読めます。

症状

Laravelでデプロイをしたときに以下のエラーが出てきてうまくデプロイできなかった。

  InvalidArgumentException
  Please provide a valid cache path.
  at vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
     32▕      */
     33▕     public function __construct(Filesystem $files, $cachePath)
     34▕     {
     35▕         if (! $cachePath) {
  ➜  36▕             throw new InvalidArgumentException('Please provide a valid cache path.');
     37▕         }
     38▕
     39▕         $this->files = $files;
     40▕         $this->cachePath = $cachePath;
      +20 vendor frames
  21  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
      +5 vendor frames
  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

解決策

フォルダーがないためエラーが発生しているので以下のようにファイルを作成してあげれば解決する

Bash
mkdir -p storage/framework/cache/data/
mkdir -p storage/framework/app/cache
mkdir -p storage/framework/sessions
mkdir -p storage/framework/views

コメント

タイトルとURLをコピーしました