Ruby/Compass Sass 语法错误

Ruby/Compass Sass syntax error

这里是 Compass 的第一次用户,在让我的 sass 编译器工作时遇到问题。我按照在线教程进行操作,但出现此错误:

错误

syntaxError on line ["24"] of C: C:/Users/Casey/Sites/devdesktop/bootstrap-subtheme/themes/less_subtheme/config.rb:1: 
syntax error, unexpected tIDENTIFIER, expecting end-of-input
..."/themes/less_subtheme" css_dir = "css" sass_dir = "assets/s...

config.rb 文件

ruby http_path = "/themes/less_subtheme" css_dir = "css" sass_dir = "assets/sass" images_dir = "assets/images" javascripts_dir = "js" fonts_dir = "bootstrap/fonts/bootstrap" generated_images_dir = "img" http_images_path = http_path + "/" + generated_images_dir http_generated_images_path = http_images_path output_style = (environment == :production) ? :compressed : :expanded

我重写了我复制的代码,以确保没有 有趣的 引号或空格被复制过来,但我仍然遇到同样的错误。

这是因为你所有的代码都在一行上,而且开头出现了"ruby"。试试这个

http_path = "/themes/less_subtheme"
css_dir = "css"
sass_dir = "assets/sass"
images_dir = "assets/images"
javascripts_dir = "js"
fonts_dir = "bootstrap/fonts/bootstrap"
generated_images_dir = "img"
http_images_path = http_path + "/" + generated_images_dir
http_generated_images_path = http_images_path
output_style = (environment == :production) ? :compressed : :expanded