我正在尝试编译我的SCSS文件,但我总是遇到此错误。这是新的,因为在Windows 10 Creator Update之前它运行正常。
以下是错误:
$ sass --no-cache --update --trace app.scss:app.css
c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:516:in `initialize': Permission denied @ rb_sysopen - appp.css (Errno::EACCES)
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:516:in `open'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:516:in `write_file'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:503:in `update_stylesheet'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:209:in `each'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/plugin.rb:82:in `update_stylesheets'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb:340:in `watch_or_update'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb:51:in `process_result'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/exec/base.rb:52:in `parse'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/lib/sass/exec/base.rb:19:in `parse!'
from c:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.4.25/bin/sass:13:in `<top (required)>'
from c:/Ruby24-x64/bin/sass:23:in `load'
from c:/Ruby24-x64/bin/sass:23:in `<main>'
我检查了编译器失败的地方,这就是我得到的:
513 def write_file(fileName, content)
514 flag = 'w'
515 flag = 'wb' if Sass::Util.windows? && options[:unix_newlines]
516 File.open(fileName, flag) do |file|
517 file.set_encoding(content.encoding) unless Sass::Util.ruby1_8?
518 file.print(content)
519 end
520 end
答案 0 :(得分:0)
刚发现问题。无论出于何种原因,如果文件位于带空格的路径中,它将无法工作。我将文件夹移动到了一个安全的地址&#34;它就像一个魅力。