From ebe87be2a965ca04c1a31f8bcf0444761056f25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dubois?= Date: Mon, 4 Sep 2023 13:19:10 +0200 Subject: [PATCH 1/2] Suggest defining config.assets.css_compressor = nil for projects with legacy sassc-rails --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ee8e906..7b6de77 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,15 @@ Some CSS packages use new CSS features that are not supported by the default Sas A common issue is that your repository does not contain the output directory used by the build commands. You must have `app/assets/builds` available. Add the directory with a `.gitkeep` file, and you'll ensure it's available in production. +### How do I avoid `ActionView::Template::Error: Error: Function rgb is missing argument $green`? + +This might happen if your Gemfile.lock contains the legacy `sassc-rails`, which might be need while progressively migrating your project, or which might be a transitive dependency of a gem your project depends on and over which you have no control. In this case, prevent Sprockets from bundling the CSS, as it is now taken care of by this gem. Make sure do this for all environments, not only production, otherwise your test suite may fail. + +``` +# config/initializers/assets.rb +Rails.application.config.assets.css_compressor = nil +``` + ### Why isn't Rails using my updated css files? Watch out - if you precompile your files locally, those will be served over the dynamically created ones you expect. The solution: From cbcc39aaea6d88b58c8bb9fdda559f098ac4ae4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dubois?= Date: Mon, 4 Sep 2023 13:26:44 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b6de77..a6c1db4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ A common issue is that your repository does not contain the output directory use ### How do I avoid `ActionView::Template::Error: Error: Function rgb is missing argument $green`? -This might happen if your Gemfile.lock contains the legacy `sassc-rails`, which might be need while progressively migrating your project, or which might be a transitive dependency of a gem your project depends on and over which you have no control. In this case, prevent Sprockets from bundling the CSS, as it is now taken care of by this gem. Make sure do this for all environments, not only production, otherwise your test suite may fail. +This might happen if your Gemfile.lock contains the legacy `sassc-rails`, which might be need while progressively migrating your project, or which might be a transitive dependency of a gem your project depends on and over which you have no control. In this case, prevent Sprockets from bundling the CSS on top of the bundling already performed by this gem. Make sure do this for all environments, not only production, otherwise your test suite may fail. ``` # config/initializers/assets.rb