Sass Compass watch编辑后在config.rb中生成语法错误

Sass Compass watch编辑后在config.rb中生成语法错误,sass,compass-sass,Sass,Compass Sass,我正在我的Web服务器上使用带指南针的SASS。在编辑我的config.rb文件并运行“compass watch”后,它抛出以下错误。在编辑文件之前,它没有抛出错误。这里会出什么问题?这可能是我的编辑器(coda)保存文件的方式吗?还是发生了什么事 syntax error, unexpected tSTRING_BEG, expecting $end @import "compass" config.rb # Require any additional compass plugins h

我正在我的Web服务器上使用带指南针的SASS。在编辑我的config.rb文件并运行“compass watch”后,它抛出以下错误。在编辑文件之前,它没有抛出错误。这里会出什么问题?这可能是我的编辑器(coda)保存文件的方式吗?还是发生了什么事

syntax error, unexpected tSTRING_BEG, expecting $end
@import "compass"
config.rb

# Require any additional compass plugins here.

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
@import "compass"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

很可能尾码正在更改文件的格式,我打赌是EOL(行尾)字符。My config.rb具有UNIX换行符,并按其应有的方式编译(Windows换行符也可以)。如果我将其更改为Mac newlines,则会出现以下错误(与您的错误非常接近):

我的编辑器(Notepad++)说该文件编码为ANSI。将其更改为“我的编辑器”支持的某些其他编码将产生如下错误:

$ compass watch
SyntaxError on line ["24"] of /usr/local/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb: /path/to/config.rb:1: invalid multibyte char (US-ASCII)
Run with --trace to see the full backtrace

您是否尝试撤消所做的任何更改?完整的config.rb文件会很有帮助。是的,我试过了。似乎它在编辑文件后创建了错误。我已经编辑了我的帖子,并包含了config.rb文件内容。通常,模块导入位于顶部,
#的正下方,需要任何其他compass插件。
注释。您是否有机会更新compass?我知道你说你只编辑了文件,但我只是检查:)@matija不,没有更新Compass谢谢!这确实是一个新的问题。在尾波中,文件使用了LF,将其改为CR就成功了。
$ compass watch
SyntaxError on line ["24"] of /usr/local/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb: /path/to/config.rb:1: invalid multibyte char (US-ASCII)
Run with --trace to see the full backtrace