configuring new project and .sass-cache directory question

1,631 views
Skip to first unread message

Chris Marisic

unread,
Aug 12, 2009, 4:01:25 PM8/12/09
to Compass
I'm creating a new website and want to integrate compass into it
however I don't want all of compasses files just sitting in the middle
of my website so I want to have a folder structure similar to this

C:\
---Project\
---------------Compass\
---------------Web\
-------------------------CSS\
-------------------------SASS\

In the config.rb do the the css_dir / sass_dir etc support back
ticking for locations of files such as:

css_dir = "..\Web\CSS"
sass_dir = "..\Web\SASS"

Inside the default src directory what is the purpose of .sass-cache?
Can I remove it?

If the cache directory is important is there a way that I can have it
sit in a temporary directory or in any directory other than my SASS
directory?

Chris Eppstein

unread,
Aug 12, 2009, 4:29:05 PM8/12/09
to compas...@googlegroups.com
The .sass-cache directory is a cache of compiled sass code, it speeds up the compilation of sass that imports other sass (as compass projects do a lot).

You can configure the sass cache location by setting a sass option in your compass configuration file like so:

sass_options = {:cache_location => "#{Compass.configuration.project_path}\tmp\sass-cache"}

Chris

Chris Marisic

unread,
Aug 12, 2009, 4:48:46 PM8/12/09
to Compass
This is my config.rb

# Require any additional compass plugins here.
project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
output_style = :compact
# To enable relative paths to assets via compass helper functions.
Uncomment:
relative_assets = true
sass_options = {:cache_location => "#
{Compass.configuration.project_path}\tmp\sass-cache"}

Calling compass now returns

C:\Project\Compass>compass
exists css
unchanged sass/ie.sass
unchanged sass/print.sass
compile sass/screen.sass
Errno::EINVAL on line 243 of C: Invalid argument - C:/Project/
Compass mp ass-cache
Run with --trace to see the full backtrace

Also what about the different folder structure question? When I tried

css_dir = "..\web\css"

I get the message as if i called compass in a directory without any
compass files. Will it only work if I hard code paths instead of using
relative ones?

Chris Eppstein

unread,
Aug 12, 2009, 5:03:02 PM8/12/09
to compas...@googlegroups.com
I don't really understand your directory structure. What lives in \Compass? Is that where you keep the config file?

If you have a config directory you can keep the compass.config file there...

Project\
-- config\
---- compass.config
-- Web\
---- SASS\
---- CSS\

Then you can just run the compass command line from the top level of your project and set the css and sass directories normally. You can also pass the configuration file path explicitly to the compass command line tool using the -c option. That said, the relative paths should work...

Can you please run the tool with --trace and post the full trace to somewhere like http://gist.github.com and send a link?

Chris Marisic

unread,
Aug 13, 2009, 11:58:15 AM8/13/09
to Compass
Chris,

I put up as much information as possible on gist for you:
http://gist.github.com/167259

Thanks for your quick responses on trying to help me!

On Aug 12, 5:03 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> I don't really understand your directory structure. What lives in \Compass?
> Is that where you keep the config file?
> If you have a config directory you can keep the compass.config file there...
>
> Project\
> -- config\
> ---- compass.config
> -- Web\
> ---- SASS\
> ---- CSS\
>
> Then you can just run the compass command line from the top level of
> your project and set the css and sass directories normally. You can
> also pass the configuration file path explicitly to the compass
> command line tool
> using the -c option. That said, the relative paths should work...
>
> Can you please run the tool with --trace and post the full trace to
> somewhere likehttp://gist.github.comand send a link?

Chris Eppstein

unread,
Aug 13, 2009, 12:12:41 PM8/13/09
to compas...@googlegroups.com
I have to ask an obvious question: are there any sass files in your
sass directory?

Hunt & pecked on my iPhone... Sorry if it's brief!

Chris Marisic

unread,
Aug 13, 2009, 12:28:05 PM8/13/09
to Compass
Yes, as you can see one the 2nd run it notices the screen.sass is
changed


C:\Proj\Config>compass
exists css
unchanged sass/ie.sass
unchanged sass/print.sass
compile sass/screen.sass


> >> somewhere likehttp://gist.github.comandsend a link?

Chris Marisic

unread,
Aug 17, 2009, 8:17:36 AM8/17/09
to Compass
Any ideas on either one of these? Both of these are just for personal
preference on project layout to reduce imo code smell. Having the sass-
cache dir inside my web project folder isn't really acceptable to me
since it will inevitably end up under source control. So any way I can
get it out of there either to a temp directory or just some other
folder that is a noncode folder is all I need to accomplish.

Chris Eppstein

unread,
Aug 17, 2009, 10:29:54 AM8/17/09
to compas...@googlegroups.com
Sorry, it was my daughter's birthday this weekend and we had guests --- didn't get a chance to dig into this like I meant to.

I don't have a windows machine, I think there are bugs, but it's hard to diagnose them. I would appreciate any help from the windows users in the community to help out diagnosing and fixing this problem.

Chris

Chris Marisic

unread,
Aug 17, 2009, 11:53:40 AM8/17/09
to Compass
I tried something new instead of using an environment variable for the
cache location i used a static location of just "c:\compass\tmp\sass-
cache" and now i have a new error message

Errno::ENOTDIR on line 243 of C: Not a directory - #c:☼mpass mp ass-
cache

Here is the trace output on gist: http://gist.github.com/169200

From seeing the weird characters in the error message could this
possible have something to do with differences in the windows line
termination characters? or with specifically the \ slash not getting
escaped correctly? Since it looks like it's eating the first chracter
after the \c and creating a non ascii character from the slash.
Looking more at the message it seems like this might be the issue
since the T is gone and it looks like a tab is there where \t is and
\s looks like a space. this really makes me think it's related to
character encoding/escaping.

Chris Eppstein

unread,
Aug 17, 2009, 12:46:54 PM8/17/09
to compas...@googlegroups.com, Compass
Oh. Duh. Yes, you're absolutely right.

Change to using single quotes or double up your \ like so \\ when
using double quotes.

Sorry!
Chris

Hunt & pecked on my iPhone... Sorry if it's brief!

Chris Marisic

unread,
Aug 17, 2009, 1:01:41 PM8/17/09
to Compass
C:\MyProj\Library\Compass>compass
exists stylesheets
unchanged src/ie.sass
unchanged src/print.sass
compile src/screen.sass
overwrite stylesheets/screen.css

I bet my issue with trying to backtrack directories was the exact same
since in the default config.rb all of the dir names are with "css" and
I was using single \. It's always a good day when a really weird issue
can be fixed without even a single line of code needing changed.
Somewhere this should probably be documented, I'd recommend inside the
config.rb's that compass creates.

Chris Eppstein

unread,
Aug 17, 2009, 1:18:44 PM8/17/09
to compas...@googlegroups.com
Good point. I'll add a note to the configuration page on the wiki. You're actually the first person to set the sass-cache directory... thanks for being such a good guinea pig.

Chris
Reply all
Reply to author
Forward
0 new messages