You can use the Sass Engine in your app like this too:
color = "#0000ff"
engine = Sass::Engine.new("#main {background-color: #{color};height: pow(10,2)px}", :syntax => :scss)
engine.render
=> "#main {\n background-color: #0000ff;\n height: 100 px; }\n"
pow() is a compass function just to show you can use compass there. You need to have the compass gem in your Gemfile.
See under "Using Sass" here: