Compass use on existing project

5,091 views
Skip to first unread message

Ian

unread,
May 24, 2011, 5:41:42 AM5/24/11
to Compass
I have the latest versions of compass and sass installed and I just
want to setup the watch on a stylesheets directory of an existing
project. My folder structure is like this:

project/
assets/
img/
js/
stylesheets/
config.rb
css/
sass/

I navigate to the assets/ directory and then run:

'compass watch stylesheets'

This used to work up to yesterday but now I'm now getting the
following message:

'Nothing to compile. If you're trying to start a new project, you have
left off the directory argument.
Run "compass -h" to get help.'

I just wanted to confirm that this is the right way to run compass and
also why this wouldn't be working?

Thanks

Erik Zettersten

unread,
May 24, 2011, 9:53:46 AM5/24/11
to compas...@googlegroups.com
$ cd <myproject>
$ compass create . --bare --sass-dir "assets/stylesheets/sass" --css-dir "assets/stylesheets/css" --javascripts-dir "assets/js" --images-dir "assets/img"
 

Make sure you're in the project's home directory.
The code above will create the config ruby file in your project's home. From there you can do the "$ compass watch ." command.

Hope that helps you.

Erik



Ian
May 24, 2011 5:41 AM

Ian

unread,
May 24, 2011, 10:15:47 AM5/24/11
to Compass
By the project's home directory I take it you mean the very root?
project/

What does --bare represent? Is this just used when you already have an
existing project?

Ah yes, the config.rb file gets created when the new project is
instantiated. I only used Compass once before a while ago and forgot
about that. Thanks for the reminder.

Just to confirm then, this command (albeit possibly alternative
directory structure) would need to be run on each new project you want
to use Compass with?

Thanks for the pointers.

On May 24, 2:53 pm, Erik Zettersten <erik.zetters...@gmail.com> wrote:
> |$ cd<myproject>
> $ compass create . --bare --sass-dir "assets/stylesheets/sass" --css-dir "assets/stylesheets/css" --javascripts-dir "assets/js" --images-dir "assets/img"|
>
> Make sure you're in the project's home directory.
> The code above will create the config ruby file in your project's home.
>  From there you can do the "$ compass watch ." command.
>
> Hope that helps you.
>
> Erik
>
>
>
>
>
>
>
> > ------------------------------------------------------------------------
>
> >    Ian <mailto:creativev...@googlemail.com>

Erik Zettersten

unread,
May 24, 2011, 10:29:00 AM5/24/11
to compas...@googlegroups.com
Sorry for the lack of explanation,

Yes, by project's home directory I do mean root ("/project").

--bare tells Compass to use nothing of it's own "starter" goodies. It will not add any directory structure and/or stylesheets it "thinks" you need.

You wounding need to run this command at the start of every Compass project. It is simply a way to setup a very custom directory structure with Compass.

In most cases Compass can be used like this,
compass create <myproject>
 
The upside to this simple create command is that it creates starter stylesheets and a fairly well organized assets directory. The downside, what you've just witnessed, is that it doesn't play well with existing projects.

If compass is something you'd want to use on every project I'd recommend checking out the following site: http://compass.handlino.com/
Its cool little app with native osx and windows support that gives you compass as a "GUI".

Erik




Ian
May 24, 2011 10:15 AM

By the project's home directory I take it you mean the very root?
project/

What does --bare represent? Is this just used when you already have an
existing project?

Ah yes, the config.rb file gets created when the new project is
instantiated. I only used Compass once before a while ago and forgot
about that. Thanks for the reminder.

Just to confirm then, this command (albeit possibly alternative
directory structure) would need to be run on each new project you want
to use Compass with?

Thanks for the pointers.



Erik Zettersten
May 24, 2011 9:53 AM

$ cd <myproject>
$ compass create . --bare --sass-dir "assets/stylesheets/sass" --css-dir "assets/stylesheets/css" --javascripts-dir "assets/js" --images-dir "assets/img"
 

Make sure you're in the project's home directory.
The code above will create the config ruby file in your project's home. From there you can do the "$ compass watch ." command.

Hope that helps you.

Erik


May 24, 2011 5:41 AM

Ian

unread,
May 24, 2011, 11:43:23 AM5/24/11
to Compass
No problem. I just wanted to confirm some of the things you mentioned
so I can understand it a little better and learn for future use. That
all makes good sense now.

Compass is certainly something I intend to use on every project from
now on. It's definitely the new defacto standard but as far as the GUI
goes, I'd much prefer to learn it from the command line. There doesn't
seem to be too much to it once the project is setup and I prefer the
understanding of knowing what it's doing and why. After one or two
projects it'll be a breeze. :) So I appreciate the explanation. I'm
familiarising myself with the docs and have pre-ordered the MEAP Sass
and Compass in Action book -fantastic! It's been a long time coming
but I'm glad it's finally under way.




On May 24, 3:29 pm, Erik Zettersten <erik.zetters...@gmail.com> wrote:
> Sorry for the lack of explanation,
>
> Yes, by project's home directory I do mean root ("/project").
>
> --bare tells Compass to use nothing of it's own "starter" goodies. It
> will not add any directory structure and/or stylesheets it "thinks" you
> need.
>
> You wounding need to run this command at the start of every Compass
> project. It is simply a way to setup a very custom directory structure
> with Compass.
>
> In most cases Compass can be used like this,
>
> |compass create<myproject>|
>
> The upside to this simple create command is that it creates starter
> stylesheets and a fairly well organized assets directory. The downside,
> what you've just witnessed, is that it doesn't play well with existing
> projects.
>
> If compass is something you'd want to use on every project I'd recommend
> checking out the following site:http://compass.handlino.com/
> Its cool little app with native osx and windows support that gives you
> compass as a "GUI".
>
> Erik
>
>
>
>
>
>
>
> > ------------------------------------------------------------------------
>
> >    Ian <mailto:creativev...@googlemail.com>
> > May 24, 2011 10:15 AM
>
> > By the project's home directory I take it you mean the very root?
> > project/
>
> > What does --bare represent? Is this just used when you already have an
> > existing project?
>
> > Ah yes, the config.rb file gets created when the new project is
> > instantiated. I only used Compass once before a while ago and forgot
> > about that. Thanks for the reminder.
>
> > Just to confirm then, this command (albeit possibly alternative
> > directory structure) would need to be run on each new project you want
> > to use Compass with?
>
> > Thanks for the pointers.
>
> > ------------------------------------------------------------------------
>
> >    Erik Zettersten <mailto:erik.zetters...@gmail.com>
> > May 24, 2011 9:53 AM
>
> > |$ cd <myproject>
> > $ compass create . --bare --sass-dir "assets/stylesheets/sass"
> > --css-dir "assets/stylesheets/css" --javascripts-dir "assets/js"
> > --images-dir "assets/img"|
>
> > Make sure you're in the project's home directory.
> > The code above will create the config ruby file in your project's
> > home. From there you can do the "$ compass watch ." command.
>
> > Hope that helps you.
>
> > Erik
>
> > ------------------------------------------------------------------------
>
> >    Ian <mailto:creativev...@googlemail.com>

Jorge Medrano

unread,
Sep 4, 2013, 7:19:47 PM9/4/13
to compas...@googlegroups.com
Thanks a lot! This command works great! Just a little advice: with this project structure:
project/
     css/
     images/

I created the sass directory at the same level of the css one. Now, if you try to watch the folder right after creating the sass directory, the command line will return again the error "nothing to compile". You just need to create the first .scss file and you're good to go and start watching or compile the project. :)
Reply all
Reply to author
Forward
0 new messages