Recently, I was working on a sass project and then started to get strange errors about a file not being found. The error referenced a non-existent file in the sass cache folder. I wasn’t sure why the file was not being generated, I had never seen this before.
The error came in two forms:
Change block raise an execption: No such file or directory @ rb_sysopen - C:/xampp-7.0/htdocs/long-project-name/site/wp-content/themes/long-theme-name/.sass-cache/75fcaf1b4852ceb732871195e41567cc2a7d8997/C%058/xampp-7.0/htdocs/long-project-name/site/wp-content/themes/long-theme-name/sass/variables-site/_variables-site.scssc20170119-11248-10zrts9 Errno::ENOENT on line ["133"] of C: No such file or directory @ rb_sysopen - C:/xampp-7.0/htdocs/long-project-name/site/wp-content/themes/long-theme-name/.sass-cache/75fcaf1b4852ceb732871195e41567cc2a7d8997/C%058/xampp-7.0/htdocs/long-project-name/site/wp-content/themes/long-theme-name/sass/variables-site/_variables-site.scssc20170118-6116-lkkzsz Run with --trace to see the full backtrace
I ran “cache clean” but it only temporarily fixed the problem, and after saving the error would reappear.
After double checking imports I was convinced that my imports were done correctly, and starting searching online.
It turns out my .sass-cache path was too long, and the file was silently failing and not being outputted to that directory. It never mentioned anywhere that my path was too long, I was trying a suggestion found here:
To fix it,
Add this line to to your config.rb
cache_path = 'C:\temp\sass'
For the record I am using: