1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Rails】Webpacker::Manifest::MissingEntryErrorの対処法【Docker】

Posted at

環境

Ruby 2.6.6
Rails 6.1.1
Docker 20.10.2

はじめに

Docker環境でRailsアプリを開発中に、サーバーを起動しhttp://localhost:3000/にアクセスすると発生。
Rails6ではwebpackerが標準サポートとなり、webpakerのインストールにはパッケージマネージャーであるyarnが必要。

エラーの解決方法

1)まずyarnで必要なライブラリをインストールする

$ bin/yarn

2)次にwebpackでJavaScriptのコンパイルをする

$ bin/webpack

3)最後にJS配信用のdevサーバーを起動する。(自動でwatch&コンパイルされる)

$ bin/webpack-dev-server

これをした後に一応docker-compose up -dで再起動し、localhost:3000にアクセスすると表示されました!
2と3はどちらかだけでも良いかも??

参考

【Rails6】Webpacker::Manifest::MissingEntryErrorが出たときの対処法

【Rails】インストール時につまづきがちなエラー集】

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?