From b6713b2f538cb4d085b54e05f2e731a380de875b Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Thu, 10 Oct 2019 10:29:41 +0200 Subject: [PATCH] Create app/assets/images on install for Sprockets 4 compatibility Sprockets 4 uses manifest files[1], and the default manifest.js links `app/assets/images`. To prevent it from crashing due to the directory not being present, the easiest solution is to create an empty `app/assets/images` directory. [1]: https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs --- core/lib/generators/spree/install/install_generator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/lib/generators/spree/install/install_generator.rb b/core/lib/generators/spree/install/install_generator.rb index 39bf0296994..21975b5f05d 100644 --- a/core/lib/generators/spree/install/install_generator.rb +++ b/core/lib/generators/spree/install/install_generator.rb @@ -58,6 +58,9 @@ def additional_tweaks def setup_assets @lib_name = 'spree' + + empty_directory 'app/assets/images' + %w{javascripts stylesheets images}.each do |path| empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test? empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test?