How can I setup compass on netbeans 7.4

Dieter Gribnitz picture Dieter Gribnitz · Oct 4, 2013 · Viewed 11.1k times · Source

There is a feature in netbeans 7.4 that allows scss and less to auto compile on save.

I have managed to set up scss to compile but I am having problems compiling scss files using compass.

Here is an example error:

Syntax error: File to import not found or unreadable: compass/css3.
          Load path: /www/site
    on line 2 of /www/site/app/View/Themed/Admin/webroot/scss/core.scss

Currently the compass is imported like so:

@import "compass/css3";

Thanks

Answer

user19292 picture user19292 · Oct 24, 2013
  1. In NetBeans, click the File > Project Properties menu item.
  2. In the dialog that opens, select the CSS Preprocessors category.
  3. At the bottom of the Sass properties is Compiler options. Enter --compass

That fixed the problem you are asking about for me. However, I then encountered further problems with Compass because it was ignorant of the paths to files. To overcome this I created a config.rb file in the root of my project. This had to define a full project path and directory names. Moreover, working on a Windows machine, it was fussy about the direction of slashes and types of quotes.

project_path    = 'c:\path\to\project'
css_dir         = "css"
sass_dir        = "sass"
images_dir      = "images"
javascripts_dir = "js"