Compass is a Ruby gem that provides a stylesheet authoring framework based on Sass. It is an awesome way to generate CSS. I ran into some trouble getting my Ruby on Rails application to run on Heroku until I cam across a Gist by Michael van Rooijen which I have added to a bit to prevent interruption of work in development.
· ANDREW GERTIG
How to get Compass to work on Heroku
Recovered companions
Historical source code and transcript text. Live Gist files may differ from the original embedded revisions; no archived code is executed.
heroku-compass-setup.rb
Live source companion; exact historical-revision equivalence is unverified. Code was preserved, not executed.
##
# Inside: Rails.root/config/compass.rb
if Rails.env.production?
css_dir = "tmp/stylesheets/compiled"
else
css_dir = "public/stylesheets/compiled"
end
##
# Inside: Rails.root/config/initializers/compass.rb
if Rails.env.production?
require 'fileutils'
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "compiled"))
end
##
# Inside: Rails.root/config.ru
require ::File.expand_path('../config/environment', __FILE__)
if Rails.env.production?
use Rack::Static, :urls => ["/stylesheets/compiled"], :root => "tmp" #FOR COMPASS
end
run YouAppName::Application