public
Created

Trying to get Compass working with the Rails 3.1 asset pipeline

  • Download Gist
1_Gemfile
1 2
gem 'sass-rails', :git => 'https://github.com/rails/sass-rails.git'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
2_application.rb
Ruby
1 2 3 4
config.assets.prefix = "myAppPrefix/assets"
config.sass.load_paths ||= []
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
config.compass.images_dir = "public/images"
3_compass.rb
Ruby
1 2 3 4
project_type = :rails
http_path = "/myAppPrefix"
css_dir = "public/myAppPrefix/stylesheets/"
sass_dir = "app/assets/stylesheets"
4_screen.css.scss
SCSS
1 2 3 4 5
// in app/assets/stylesheets/screen.css.scss
@import "compass";
@import "reset.css.scss";
@import "mixins/utilities.css.scss";
...

I wrote an article that might help some too.

Use Compass Sass Framework Files With The Rails 3.1.0.rc5 Asset Pipeline
http://metaskills.net/2011/07/29/use-compass-sass-framework-files-with-the-rails-3.1.0.rc5-asset-pipeline/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.