Rails Doesn't Compile SASS

369 views
Skip to first unread message

Karl

unread,
Nov 23, 2009, 10:32:06 PM11/23/09
to Compass
Knocking my head around too long on this... new rails app, just
installed compass using "rake rails:template LOCATION=http://compass-
style.org/rails/installer" and rails just won't compile the sass.

This is all I get (development):
Processing ApplicationController#index (for 127.0.0.1 at 2009-11-23
20:11:35) [GET]
ActionController::RoutingError (No route matches "/stylesheets/
compiled/screen.css" with {:method=>:get}):
Rendering rescues/layout (not_found)

Which pretty much makes sense, because there is no screen.css being
generated by sass.

If I "compass -u" it compiles them just fine. But changes to the
source .sass do not get recompiled.

Specs:
Rails 2.3.4
chriseppstein-compass (0.8.17)
haml (2.2.14, 2.2.13)

Ideas? Let me know if I should post anything else.

Chris Eppstein

unread,
Nov 23, 2009, 10:39:48 PM11/23/09
to compas...@googlegroups.com
I guess you can try the built-in installer:

compass --rails -f blueprint path/to/project

The important bits are the initializer file in config/initializers/compass.rb and the config file in config/compass.config. If you don't have those files you'll be very sad.

Lastly, sass doesn't compile in production mode... so make sure you're running in development mode.


--

You received this message because you are subscribed to the Google Groups "Compass" group.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.



Karl

unread,
Nov 23, 2009, 10:59:11 PM11/23/09
to Compass
On Nov 23, 8:39 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> The important bits are the initializer file in
> config/initializers/compass.rb and the config file in config/compass.config.
> If you don't have those files you'll be very sad.

Bingo! config/initializers/compass.rb was there but blank. Delete, re-
init compass... life is sweet again.

Thanks, Chris.

Don't know if this would help others, but maybe when compass does an
initialization of a project, if it finds existing files, maybe it
could suggest replacement or update? I know that if compass at least
complained about an existing file, it would have led me to at least
investigate.

Chris Eppstein

unread,
Nov 23, 2009, 11:38:54 PM11/23/09
to compas...@googlegroups.com
On Mon, Nov 23, 2009 at 7:59 PM, Karl <threa...@gmail.com> wrote:
On Nov 23, 8:39 pm, Chris Eppstein <ch...@eppsteins.net> wrote:

Bingo! config/initializers/compass.rb was there but blank. Delete, re-
init compass... life is sweet again.

Cool. I was pretty much out of ideas if that wasn't it ;-)
 
Don't know if this would help others, but maybe when compass does an
initialization of a project, if it finds existing files, maybe it
could suggest replacement or update? I know that if compass at least
complained about an existing file, it would have led me to at least
investigate.

It's the other way around. Rails tells compass to load and since the config file was there the command line was working fine... There's not really a way for software to detect this failure scenario.

chris

Karl

unread,
Nov 24, 2009, 1:59:42 PM11/24/09
to Compass
On Nov 23, 9:38 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> > Don't know if this would help others, but maybe when compass does an
> > initialization of a project, if it finds existing files, maybe it
> > could suggest replacement or update? I know that if compass at least
> > complained about an existing file, it would have led me to at least
> > investigate.
>
> It's the other way around. Rails tells compass to load and since the config
> file was there the command line was working fine... There's not really a way
> for software to detect this failure scenario.

I mean when you are adding compass to a project, say if you issue
"compass -f blueprint . --rails" and compass finds existing
compass.rb, compass.config.

BTW, I did use the --update option as well, and obviously it did not
update the compass.rb file.

In my case, I think I issued the above command and forgot the
<project_path> (or some other misgiving), so it created some of the
empty config files and crapped out. When I corrected my mistake,
existing compass.rb and compass.config files existed but were empty. I
easily spotted the compass.config, deleted it, and reran the command.
I didn't spot compass.rb.

If compass would have warned me about existing files, it could asked
to skip/replace or at a minimum warned me that it was skipped. Same as
script/generate typically does. Could be handy for those updating
existing projects that may require new config files.

Just a thought.
Reply all
Reply to author
Forward
0 new messages