使用Compass将Susy导入Rails项目时出现问题

时间:2012-09-22 01:06:11

标签: ruby-on-rails-3 sass susy-compass

我使用以下gemfile开始了一个新的rails项目:

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'

然后我尝试@import "susy";进入我的application.css.scss文件,但失败并出现以下错误:

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)

导入sassy-buttons有效但susy不是出于某种原因。

1 个答案:

答案 0 :(得分:1)

如果您遇到此问题,那么您可能正在使用战俘。

事实证明,POW没有看到所需的插件,所以SASS无法编译。

对此的一个hacky修复是每次将新的Compass插件导入SASS文件时运行rails s。更好的是将POW倾倒,直到它被修复。