Search code examples
rubygrailsconfigcompass-sass

compass config file location / name


I'm new to Compass (and Ruby too), and I'm wondering about the naming convention of the Compass config file.

As a default, Compass creates a file called config.rb within the directory where the compass create command is executed. As I'm developing a Grails web app, I try to initialize it within C:\Source\MyGrailsProject\web-app\config as I want to have all configuration files within one directory so that I could remove it from the created WAR file easily.

Now, I read that the name of the configuration file can also be like config/compass.rb [1] and I tried the following:

  • create the Compass configuration file with all specific settings under the config directory

  • run compass create C:\Source\MyGrailsProject\web-app --bare from the command line (--bare is used to not have Compass creating the default directory structure as this is a already set up project [2])

  • delete the created config.rb file from the web-app folder, as I previously created the configuration file under config/compass.rb

  • run compass compile C:\Source\MyGrailsProject\web-app or, alternatively compass compile C:\Source\MyGrailsProject\web-app\config - both of them show the "Nothing to compile ..." log which also comes up if Compass is not set up at all!

what am I doing wrong here? shouldn't it be possible to so?


[1] https://github.com/chriseppstein/compass/issues/751

[2] https://groups.google.com/d/msg/compass-users/w1wZd4bKbGo/vNlYJTgCm4kJ


Solution

  • as @IgorArtamonov stated in his first comment on my initial question, I had declared the wrong directory paths within my config file. this issue was not obvious for me as I thought, that I had to declare the directory paths relative to the config file - instead, one has to declare the directory paths relative to the compass project path...

    so, let's say I have my Compass Project Path at /path/to/my/project and my config file is located under /path/to/my/project/config/compass.rb. all other files are also in miscellaneous subdirectories like this:

    /path/to/my/project

    /path/to/my/project/config/compass.rb

    /path/to/my/project/css/style.css

    /path/to/my/project/js/app.js

    /path/to/my/project/scss/style.scss

    the directories declared in compass.rb have to be relative to the Compass Project Path, like this:

    css_dir = "css"
    sass_dir = "scss
    ...
    

    just in case someone else will also come accross this issue ;)