前提
初学者です。オリジナルアプリを作っておりますが、デプロイの際に以下のようなエラーが発生します。
発生している問題・エラーメッセージ
全文を載せてしまうと長いので怪しい箇所だけ一部抜粋。
エラーメッセージ warning " > webpack-dev-server@4.9.3" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0". warning "webpack-dev-server > webpack-dev-middleware@5.3.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". [5/5] Building fresh packages... Done in 2.78s. rake aborted! NoMethodError: undefined method `size' for nil:NilClass /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/util.rb:157:in `merge_adjacent_strings' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/tree/prop_node.rb:73:in `initialize' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:848:in `new' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:848:in `css_variable_declaration' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:796:in `try_declaration' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:743:in `declaration_or_ruleset' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:708:in `block_child' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:700:in `block_contents' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:689:in `block' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:681:in `ruleset' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:707:in `block_child' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:700:in `block_contents' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:137:in `stylesheet' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:41:in `parse' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/engine.rb:414:in `_to_tree' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sass-3.7.4/lib/sass/engine.rb:290:in `render' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:48:in `call' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:28:in `call' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger' /tmp/build_a201b62d/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define' Tasks: TOP => assets:precompile (See full trace by running task with --trace) ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app. ! Push failed
試したこと
最初にPrecompiling assets failed.
とターミナルで赤字で書かれていたのでこの文を検索にかけて調べたところアセットパイプラインの正常化が必要と書かれていたのでconfig/application.rbに以下のように記述し再度実行したところ変わらず。
config/application.rb
1config.assets.initialize_on_precompile = false
また再度エラー文を見ると NoMethodError: undefined method `size' for nil:NilClass
と書かれてあることに気づきましたが、どこのことを言っているのかがわかりません。
こちらについても検索をかけて調べましたが当てはまるような記事に辿り着けず苦戦しております。どなたかお分かりになる方おりましたらご教示いただけますと幸いです。
補足情報(FW/ツールのバージョンなど)
MacOS
Ruby 2.6.5
Rails 6.0.5.1
Heroku-18 stack
問題のCSSの構文
URL: https://github.com/yk8710/stock/blob/master/app/assets/stylesheets/style.css
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。