ruby-on-rails-3sasssusy-compass

Problems importing Susy into Rails project using Compass


I've started a new rails project using the following gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

group :development do
  gem 'sqlite3'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'compass-rails'
  gem 'susy'
  gem 'sassy-buttons'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'devise'

I then attempt to @import "susy"; into my application.css.scss file but it fails with the following error:

Sass::SyntaxError in Devise/sessions#new

Showing /Users/ashleyconnor/Development/rails/myapp/app/views/layouts/application.html.erb where line #5 raised:

File to import not found or unreadable: susy.
Load paths:
  Sass::Rails::Importer(/Users/ashleyconnor/Development/rails/myapp/app/assets/stylesheets/application.css.scss)
  /Users/ashleyconnor/Development/rails/myapp/app/assets/stylesheets
  /Users/ashleyconnor/.rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.12.2/frameworks/blueprint/stylesheets
  /Users/ashleyconnor/.rvm/gems/ruby-1.9.3-p194@myapp/gems/compass-0.12.2/frameworks/compass/stylesheets
  /Users/ashleyconnor/.rvm/gems/ruby-1.9.3-p194@myapp/gems/compass_twitter_bootstrap-2.0.3/stylesheets
  /Users/ashleyconnor/.rvm/gems/ruby-1.9.3-p194@myapp/gems/sassy-buttons-0.1.4/stylesheets
  Compass::SpriteImporter
  (in /Users/ashleyconnor/Development/rails/myapp/app/assets/stylesheets/application.css.scss)

Importing sassy-buttons works but susy doesn't for some reason.


Solution

  • If you're having this problem then you are probably using POW.

    It turns out that POW isn't seeing the required plugins and so the SASS can't compile.

    A hacky fix for this is to run rails s every time you import a new Compass plugin into a SASS file. Better still is to dump POW until it's fixed.