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

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

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

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

0回答

979閲覧

本番環境でrailsのassets:precompileを行うとエラーになる。

oeiqgfodgfhps

総合スコア35

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2022/01/11 08:50

編集2022/01/11 10:12

ec2の上にrailsアプリケーションを立ててデプロイを試みています。
rails assets:precompile RAILS_ENV=productionを実行したのですが、下記のようなエラーが出てしまいました。

Compiling... Compilation failed: [webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration.node should be one of these: false | object { __dirname?, __filename?, global? } -> Include polyfills or mocks for various node stuff. Details: * configuration.node has an unknown property 'dgram'. These properties are valid: object { __dirname?, __filename?, global? } -> Options object for node compatibility features. * configuration.node has an unknown property 'fs'. These properties are valid: object { __dirname?, __filename?, global? } -> Options object for node compatibility features. * configuration.node has an unknown property 'net'. These properties are valid: object { __dirname?, __filename?, global? } -> Options object for node compatibility features. * configuration.node has an unknown property 'tls'. These properties are valid: object { __dirname?, __filename?, global? } -> Options object for node compatibility features. * configuration.node has an unknown property 'child_process'. These properties are valid: object { __dirname?, __filename?, global? } -> Options object for node compatibility features.

package.json

1{ 2 "name": "attendance-app", 3 "private": true, 4 "dependencies": { 5 "@rails/actioncable": "^6.0.0", 6 "@rails/activestorage": "^6.0.0", 7 "@rails/ujs": "^6.0.0", 8 "@rails/webpacker": "5.4.3", 9 "turbolinks": "^5.2.0", 10 "webpack": "^5.65.0", 11 "webpack-cli": "^4.9.1" 12 }, 13 "version": "0.1.0", 14 "devDependencies": { 15 "webpack-dev-server": "3" 16 }, 17 "description": "This README would normally document whatever steps are necessary to get the application up and running.", 18 "main": "babel.config.js", 19 "directories": { 20 "lib": "lib", 21 "test": "test" 22 }, 23 "scripts": { 24 "test": "echo \"Error: no test specified\" && exit 1" 25 }, 26 "repository": { 27 "type": "git", 28 "url": "git+https://github.com/Kyoya-prog/attendance-app.git" 29 }, 30 "keywords": [], 31 "author": "", 32 "license": "ISC", 33 "bugs": { 34 "url": "https://github.com/Kyoya-prog/attendance-app/issues" 35 }, 36 "homepage": "https://github.com/Kyoya-prog/attendance-app#readme" 37} 38

ネットでも色々探しましたが、良さそうな解決策が見つかりませんでした。
解決策をご存知の方がいればご教授お願いいたします。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問