我搜索了很多,但是我只看到使用rails 3.1与compass结合的方法就是编辑Gemfile文件,例如:
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'sass-rails', "~> 3.1.0.rc"
是的,我理解了那个方法,但接下来怎么做呢?我看到的所有教程都只是说使用某个特定的分支。但我还是在使用Rails 3.1时遇到了使用Compass的问题。
我已经尝试了以下方法:
$ compass init rails . --syntax sass
directory ./app/stylesheets/
create ./config/compass.rb
create ./app/stylesheets/screen.sass
create ./app/stylesheets/print.sass
create ./app/stylesheets/ie.sass
由于3.1版本现在使用资源文件,我将所有这些文件转移到了3.1版本。此外,我正在使用compass-960插件,那么我应该在哪里引用它?我尝试添加一个compass.rb文件并添加require 960和require html5-boilerplate,但我仍然不断收到错误信息:
Error compiling asset application.css:
NoMethodError: undefined method `Error' for Compass:Module
(in /Users/eumir/rails_apps/kiseki/app/assets/stylesheets/screen.sass)
NoMethodError (undefined method `Error' for Compass:Module
(in /Users/eumir/rails_apps/kiseki/app/assets/stylesheets/screen.sass)):
我尝试运行 compass compile,但是出现了以下提示:
$ compass compile 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.
就像我之前说的那样,我已经编辑了我的 compass.rb 文件,所以现在还不知道该怎么处理。有人能提供帮助吗?