I'm using SASS with Compass on my webserver. After editing my config.rb file and running "compass watch" it throws up following error. Before having edited the file it didn't throw the error. What could be going wrong here? Could it be the way the file is saved by my editor (coda)? Or is something else going on?
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
It is most likely that Coda is changing the formatting of the file, my bet is on the EOL (end of line) character. My config.rb has UNIX newlines and compiles as it should (Windows newlines are also OK). If I change it to Mac newlines, I get this error (which is pretty close to your error):
$ 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: syntax error, unexpected tIDENTIFIER, expecting $end
# Require any addit...
My editor (Notepad++) says the file is encoded as ANSI. Changing it to some of the other encodings that my editor supports will give an error like this:
$ 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