Sass: errno :: enoent: No such file or directory

I know this is a terribly soft error to run, but I encounter the usual "file not found" error in Sass 3.4.2:

/* Errno::ENOENT: No such file or directory - dumdum.scss Backtrace: /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:482:in `read' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:482:in `update_stylesheet' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:209:in `each' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:209:in `update_stylesheets' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin/compiler.rb:293:in `watch' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/plugin.rb:108:in `method_missing' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/exec/sass_scss.rb:381:in `watch_or_update' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/exec/sass_scss.rb:51:in `process_result' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/exec/base.rb:52:in `parse' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/lib/sass/exec/base.rb:19:in `parse!' /Library/Ruby/Gems/2.0.0/gems/sass-3.4.12/bin/sass:13:in `<top (required)>' /usr/bin/sass:23:in `load' /usr/bin/sass:23:in `<main>' */ 

I came across this before, but I was not lucky in diagnosing / solving the problem. It also appears as a strange element on the page with which it is associated.

Can someone help me understand the trace? I'm sure this is something incredibly simple, but I know very little Ruby. I tried uninstalling / reinstalling Sass.

+6
source share
3 answers

I ran into a similar error in my project, deleting the sass-cache directory in the root of my project, and then ran sass / grunt, again solved the problem for me ...

 rm .sass-cache/ -R 

Intercepting this helps

+3
source

If Ruby or Rails (too), your backtrack means the error comes from the gem code itself. If you opened these files and followed them, you could see how Sass Gem works.

EDIT. . If you manually installed / installed the gem, it is better to run bundle install so that you correctly meet the specifications in Gemfile.lock . If such a file seems new to you, I highly recommend reading http://bundler.io/ , a gem manager that allows you to control which gems / versions are needed for your application!

NOTE If you work with Rails, the rest of my answer below may help. (From personal experience I had a couple of months ago.)

This error means that you do not have the dumdum.scss file in your directory, most likely app/assets/stylesheets/ . I suggest doing a quick grep search where you use dumdum . For example, in the application I'm working on, I have a _colors.scss file, and it references and redefines the stylesheet (for bootstrapping) as @import "colors"; .

+2
source

I had a similar problem, but I could not solve it with the above solutions, but I had to use an approach with hacking and hope.

Things I tried before my hack and hope:

  • I deleted all the .sass-cache folders that may contain my sass file.
  • I uninstalled and reinstalled the sass stone.
  • I updated Ruby and Sass. For some reason, I cannot delete the ruby ​​command line. So I still use ruby 2.3.3p222 and Sass version 3.4.23

So my solution was to use sassmeister to convert scss and that solved my problem. To compress the css file, I used CSS Compressor . This method is effective if you do not have a clean ruby ​​/ sass installation setup.

  • Then take the compressed css file and save the new CSS file with the new file name.
  • Then go to the html / php files and change the CSS file name to the new CSS file name from step 1 in yours.
  • That should do the trick. It worked for me.
0
source

Source: https://habr.com/ru/post/984813/


All Articles