uninitialized constant SassC::Script::String
AI-generated summary
A user encounters a SASSC error during db:migrate and rails server due to an uninitialized constant SassC::Script::String in a image-url function within onebox.scss. The issue is traced to a specific SassC version, with the user running sassc 2.0.1. Another user suggests a fix by downgrading to ~> 1.0 and referencing a community thread. The issue is resolved when a developer confirms that the latest version of sassc is now being used, with a commit update provided here.
Can you post the full error message? Normally this should show you which file (I would guess here that it’s a plugin) causes the SassC error.
Error: error in C function image-url: uninitialized constant SassC::Script::String
on line 277 of app/assets/stylesheets/common/base/onebox.scss, in function `image-url`
from line 277 of app/assets/stylesheets/common/base/onebox.scss, in mixin `gdocs-logo`
from line 286 of app/assets/stylesheets/common/base/onebox.scss
from line 35 of app/assets/stylesheets/common.scss
from line 1 of desktop.scss
>> background: image-url("favicons/google_branding/logo_#{$type}_48px.png")
It is a SassC error.
What version of sassc do you get when you run bundle install?
I didn’t change anything from the Gemfile, it is SassC 2.0.1.
I can’t reproduce with the same SassC version on a Mac. You could follow the solutions here for a quick fix.
Thanks, this fixed the problem for me but since this is an issue, I will suggest we flag it and allow ~> 1.0 for now
gem 'sassc', '~> 1.0', require: false
I definitely want to get sassc upgrades to latest, it is just a bit fiddly. We will make it happen in the next few months.
We are now running the latest version of sassc, thanks for the reminder @SURGE
https://github.com/discourse/discourse/commit/56b4ee43d3473601416a071c0afc185a8dc670de