前提・実現したいこと
railsチュートリアルに取り組んでいるのですが(現在6章終了段階)、git push herokuに成功しません。
7章からは本番環境を使用するそうなので、質問させていただきました。
発生している問題・エラーメッセージ
git push herokuに失敗する。 Compilation failed: remote: [webpack-cli] Failed to load '/tmp/build_085863bf/config/webpack/production.js' config remote: [webpack-cli] TypeError: Cannot read property 'toWebpackConfig' of undefined remote: at Object.<anonymous> (/tmp/build_085863bf/config/webpack/production.js:5:30) remote: at Module._compile (/tmp/build_085863bf/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) remote: at Module.load (internal/modules/cjs/loader.js:1000:32) remote: at Function.Module._load (internal/modules/cjs/loader.js:899:14) remote: at Module.require (internal/modules/cjs/loader.js:1042:19) remote: at require (/tmp/build_085863bf/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) remote: at loadConfig (/tmp/build_085863bf/node_modules/webpack-cli/lib/webpack-cli.js:1322:31) remote: at /tmp/build_085863bf/node_modules/webpack-cli/lib/webpack-cli.js:1409:74 remote: at Array.map (<anonymous>) remote: remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: f78e5846c7b08e015838c212e1d4b0143b159610 remote: ! remote: ! We have detected that you have triggered a build from source code with version f78e5846c7b08e015838c212e1d4b0143b159610 remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to stark-fjord-99600. remote: To https://git.heroku.com/stark-fjord-99600.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/stark-fjord-99600.git'
該当のソースコード
ubuntu:~/environment/sample_app (master) $ git push heroku ... remote: Compiling… remote: Compilation failed: remote: [webpack-cli] Failed to load '/tmp/build_085863bf/config/webpack/production.js' config remote: [webpack-cli] TypeError: Cannot read property 'toWebpackConfig' of undefined remote: at Object.<anonymous> (/tmp/build_085863bf/config/webpack/production.js:5:30) remote: at Module._compile (/tmp/build_085863bf/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) remote: at Module.load (internal/modules/cjs/loader.js:1000:32) remote: at Function.Module._load (internal/modules/cjs/loader.js:899:14) remote: at Module.require (internal/modules/cjs/loader.js:1042:19) remote: at require (/tmp/build_085863bf/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) remote: at loadConfig (/tmp/build_085863bf/node_modules/webpack-cli/lib/webpack-cli.js:1322:31) remote: at /tmp/build_085863bf/node_modules/webpack-cli/lib/webpack-cli.js:1409:74 remote: at Array.map (<anonymous>) remote: remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: f78e5846c7b08e015838c212e1d4b0143b159610 remote: ! remote: ! We have detected that you have triggered a build from source code with version f78e5846c7b08e015838c212e1d4b0143b159610 remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to stark-fjord-99600. remote: To https://git.heroku.com/stark-fjord-99600.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/stark-fjord-99600.git'
試したこと
/config/applicaiton.rbにconfig.assets.initialize_on_precompile = falseを追加しましたが、改善は見られませんでした。
補足情報(FW/ツールのバージョンなど)
AWS cloud9を使用しています。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。