views:

263

answers:

2

I really like the way padrino 'just works' with compass but I have a few questions as I'm going to be using heroku (and their read-only file-system) for hosting

  1. From the looks of things, the padrino/compass combo only compiles sass if changes have been made to the sass file and a user hits the server. Is that true?

  2. If so, then am I right in thinking that I won't have to worry about compass trying to write to the file-system once the app is in production mode since I won't be making any changes to my sass files when they are on the server?

  3. Are there any other situations, other than changes being made to the sass files, that will cause padrino/compass to write to the file-system?

  4. If the assumption I make in question 2 is wrong , then how can I prevent padrino/compass from writing to the file-system?

Nathan Weizenbaum (of Sass fame) advised me to use Sass::Plugin::Rack, when combining sinatra, sass, compass and heroku, but after much thought, I decided that the best option (for my needs at least) was to prevent sass from doing any kind of server-side compilation by linking to my static css files without invoking sass in my routes

I notice that compass_plugin.rb (created by the padrino generator) requires "Sass:Plugin::Rack"

I won't be able to push to heroku until tomorrow night so I'm trying to get a heads up on any problems that I might encounter

[I will ask the same question on the padrino mailing]

+1  A: 

I have a new project using Rails and Compass, and every time I push to heroku, it seems that compass does try to write to the filesystem. I get a "We're sorry, but something has gone wrong" warning when I visit the page each time after an update.

This happens despite the fact that all of the css files should exist already. Passing strange.

chadoh
yes, I was getting this problem too. but see the accepted answer for a way to fix this - it works in rails too (with a tiny bit of modification)
stephenmurdoch
+1  A: 

Got an answer on the padrino mailing list that fixes this problem

if Padrino.env == :production
   Sass::Plugin.options[:never_update] = true
end

# right before
Compass.configure_sass_plugin!
Compass.handle_configuration_change! 

It works for me

stephenmurdoch