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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

Q&A

0回答

911閲覧

Precompiling assets failed.が直らない[Railsチュートリアル 1.5.2 Herokuにデプロイする(1)]

kutakunn

総合スコア0

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

0グッド

0クリップ

投稿2021/04/17 12:38

前提・実現したいこと

git push heroku master で、Herokuにデプロイを行いたい。

発生している問題・エラーメッセージ

----> Preparing app for Rails asset pipeline Running: rake assets:precompile yarn install v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > webpack-dev-server@3.11.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.7.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". [4/4] Building fresh packages... Done in 15.93s. I, [2021-04-17T12:18:18.999490 #884] INFO -- : Writing /tmp/build_ae32ae83/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css I, [2021-04-17T12:18:18.999963 #884] INFO -- : Writing /tmp/build_ae32ae83/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz Compiling… Compilation failed: [webpack-cli] Failed to load '/tmp/build_ae32ae83/config/webpack/production.js' config [webpack-cli] TypeError: Cannot read property 'toWebpackConfig' of undefined at Object.<anonymous> (/tmp/build_ae32ae83/config/webpack/production.js:5:30) at Module._compile (/tmp/build_ae32ae83/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Module.require (internal/modules/cjs/loader.js:1042:19) at require (/tmp/build_ae32ae83/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at loadConfig (/tmp/build_ae32ae83/node_modules/webpack-cli/lib/webpack-cli.js:1322:31) at /tmp/build_ae32ae83/node_modules/webpack-cli/lib/webpack-cli.js:1409:74 at Array.map (<anonymous>) ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app. ! Push failed

該当のソースコード(ターミナル)

$ git push heroku master Counting objects: 111, done. Compressing objects: 100% (93/93), done. Writing objects: 100% (111/111), 102.95 KiB | 2.24 MiB/s, done. Total 111 (delta 7), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Determining which buildpack to use for this app remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. remote: Detected buildpacks: Ruby,Node.js remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Installing bundler 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.6 remote: -----> Installing dependencies using bundler 1.17.3 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. remote: Fetching gem metadata from https://rubygems.org/............ (省略) remote: Bundle complete! 17 Gemfile dependencies, 59 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Post-install message from sass: remote: remote: Ruby Sass has reached end-of-life and should no longer be used. remote: remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new remote: primary implementation: https://sass-lang.com/install remote: remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the remote: sassc gem: https://github.com/sass/sassc-ruby#readme remote: remote: * For more details, please refer to the Sass blog: remote: https://sass-lang.com/blog/posts/7828841 remote: remote: Bundle completed (27.41s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v12.16.2-linux-x64 remote: -----> Installing yarn-v1.22.4 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: yarn install v1.22.4 remote: [1/4] Resolving packages... remote: [2/4] Fetching packages... remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module. remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > webpack-dev-server@3.11.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: [4/4] Building fresh packages... remote: Done in 15.93s. remote: I, [2021-04-17T12:18:18.999490 #884] INFO -- : Writing /tmp/build_ae32ae83/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css remote: I, [2021-04-17T12:18:18.999963 #884] INFO -- : Writing /tmp/build_ae32ae83/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz remote: Compiling… remote: Compilation failed: remote: [webpack-cli] Failed to load '/tmp/build_ae32ae83/config/webpack/production.js' config remote: [webpack-cli] TypeError: Cannot read property 'toWebpackConfig' of undefined remote: at Object.<anonymous> (/tmp/build_ae32ae83/config/webpack/production.js:5:30) remote: at Module._compile (/tmp/build_ae32ae83/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_ae32ae83/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) remote: at loadConfig (/tmp/build_ae32ae83/node_modules/webpack-cli/lib/webpack-cli.js:1322:31) remote: at /tmp/build_ae32ae83/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: Verifying deploy... remote: remote: ! Push rejected to powerful-temple-89547. remote: To https://git.heroku.com/powerful-temple-89547.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/powerful-temple-89547.git'

試したこと

config/application.rbに、config.assets.initialize_on_precompile = falseを追加すること。
同様のエラーメッセージが発生しました。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問