开发者

Padrino, compass and heroku's read-only file-system

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 pa开发者_如何学运维drino 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]


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


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.


Heroku recently published a blog post called Using Compass on Heroku encouraging users to use the tmp directory for compiled stylesheets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜