guard/guard-compass

Can't import susy

Closed this issue · 8 comments

I'm trying to make guard-compass work with my themes but they all use the susy extension.

By doing the classic compass watch in the theme everything works, but I can't find how to make guard-compass find the susy extension. Here is the error:

error sites/all/themes/mytheme/sass/screen.sass (Line 14: File to import not found or unreadable: susy.

In the GuardFile I have this:

guard 'compass', :project_path => "sites/all/themes/mytheme", :compile_on_start => true do
  watch(%r{(.*)\.s[ac]ss$})
end

The screen.sass file has this on line 14: @import "susy"

The file sites/all/themes/mytheme/config.rb contains this:

require "susy"

And finally the Gemfile has these gems:

source "http://rubygems.org"

group :development do
  gem 'compass'            # Depends on Sass, will be installed automatically.
  gem 'susy', "~> 1.0.5"    # susy
  gem 'compass-rails', '>= 1.0.3' # required for susy
  gem 'guard-compass', :git => "https://github.com/guard/guard-compass.git" 
  ...

I've tried to follow all guide and looked at all questions about the unreadable susy file but none of the suggestions worked for me.

I've found a workaround. I simply created an extensions folder in my theme and cloned susy in it from https://github.com/ericam/susy .

It works but it would be better if the susy extension did not have to be copied in each themes.

Hi,

Are you sure you did bundle install to make sure susy is installed into your project?
Are you sure you are using bundle exec guard instead of just your system-wide guard?

I'm having the same issue, except I've moved all my files out of drupal and just created a bare-bones compass project. My setup is basically the same as the original poster, and "compass watch" and "bundle exec compass watch" output no errors when compiling, but when I try "Bundle exec guard", I get hammered with "[Sass] Sass > Syntax error: File to import not found or unreadable: singularitygs.", or whatever plugin I'm trying. In the OPs case, Suzy, in mine it's SingularityGS.

Edit: It seems this issue is very similar also - http://stackoverflow.com/questions/10836884/cannot-make-compass-guard-sass-to-work

Hi, @idflood have you tried to specify the path to your config file so that guard-compass knows where to find it, i.e.:

guard :compass, configuration_file: 'sites/all/themes/mytheme/config.rb', project_path: 'sites/all/themes/mytheme',
      compile_on_start: true do
  watch(%r{(.*)\.s[ac]ss$})
end

Hi @rymai ,
It looks like this is working : ) I've quickly checked and there was no error. However I didn't check in details since I'm not using guard anymore.

Once it was working I tried to remove the :configuration_file option and the error reappeared so this was really the only missing piece.

Glad to hear that!

@humanaut could you also try to set the :configuration_file option properly and let me know if this fixes the issue?

I will look for my project in hopes I still have it and try it.

I ended up using a different implementation I found elsewhere that is working fine.

Ok, no worries! I'll go ahead and close this issue now, feel free to re-open it if needed.