简体   繁体   English

ruby无效的UTF-8字符“ \\ xA0”(Sass :: SyntaxError)

[英]ruby Invalid UTF-8 character “\xA0” (Sass::SyntaxError)

I'm trying to run sass command 我正在尝试运行sass命令

 sass /usr/bin/ruby /usr/local/bin/sass --load-path /opt/lampp/htdocs/kunstmann/vendor/kunstmaan/admin-bundle/Kunstmaan/AdminBundle/Resources/public/scss

and I'm getting this error. 我收到这个错误。

/usr/bin/ruby:1: Invalid UTF-8 character "\xA0" (Sass::SyntaxError)
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/engine.rb:373:in `block in check_encoding!'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:604:in `rescue in block in check_encoding'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:601:in `block in check_encoding'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:600:in `each'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:600:in `each_with_index'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:600:in `check_encoding'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/util.rb:654:in `check_sass_encoding'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/engine.rb:372:in `check_encoding!'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/engine.rb:339:in `_to_tree'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/engine.rb:315:in `_render'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/engine.rb:262:in `render'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/exec.rb:349:in `process_result'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/exec.rb:41:in `parse'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/lib/sass/exec.rb:21:in `parse!'
from /var/lib/gems/1.9.1/gems/sass-3.2.13/bin/sass:13:in `<top (required)>'
from /usr/local/bin/sass:23:in `load'
from /usr/local/bin/sass:23:in `<main>'

I'v tried putting @charset "utf-8"; 我试着把@charset“ utf-8”放进去; to the beginning of sass files. 到sass文件的开头。 Also tried to include Encoding.default_external = "utf-8" to numerous config.rb files. 还尝试将Encoding.default_external =“ utf-8”包含到许多config.rb文件中。 ruby version ruby 1.9.3p484 红宝石版本红宝石1.9.3p484

UPDATE: 更新:

I'm getting css files compiled but with this error inside them. 我正在编译css文件,但其中包含此错误。 compiling with Symfony2 command: app/console assetic:dump 使用Symfony2命令编译:app / console资产:转储

[exception] 500 | Internal Server Error | Assetic\Exception\FilterException
[message] An error occurred while running:
&#039;/usr/bin/ruby&#039; &#039;/usr/local/bin/sass&#039; &#039;--load-path&#039;     &#039;/opt/lampp/htdocs/kunstmann/vendor/kunstmaan/admin-bundle/Kunstmaan/AdminBundle   /Resources/public/scss&#039; &#039;--scss&#039; &#039;--cache-location&#039;  &#039;/tmp&#039; &#039;/tmp/assetic_sasspqLusY&#039;

Error Output:
Errno::ENOENT: No such file or directory - /tmp/600d657f6ac2358f30ba6bc0ab4cd7ffb6194ced/assetic_sasspqLusYc20141111-4656-uxy3yg.lock

Use --trace for backtrace. 使用--trace进行回溯。

you are passing the ruby program /usr/bin/ruby as an argument to sass. 您将红宝石程序/ usr / bin / ruby​​作为sass的参数传递。 So sass is trying to read the ruby program which is a binary file, and that is why you are getting the error. 所以sass试图读取ruby程序,该程序是一个二进制文件,这就是为什么出现错误的原因。

remove sass from the beginning of the command. 从命令开头删除sass。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM