According to this link 
(http://blog.citrusbyte.com/2008/03/20/sass-production-woes-in-rails/),
Sass has known issues with CSS generation in Rails 2.3.  This is
remedied easily enough by providing an initializer that forces the
plugin to "reload" a little later in the process, but the exact
mechanism isn't completely understood.  This is an interaction
between the Haml and Sass gems, since Haml vendors Sass.  When we
upgrade Haml to 3.2.0, we should be able to remove this
initializer.

This change may negatively impact the first page load on a new
server, but the change is fairly minimal.

Reviewed-By: Matt Robbinson

Signed-off-by: Pieter van de Bruggen <[email protected]>
---
Local-branch: tickets/master/8121
 config/initializers/sass.rb |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 config/initializers/sass.rb

diff --git a/config/initializers/sass.rb b/config/initializers/sass.rb
new file mode 100644
index 0000000..ed614d3
--- /dev/null
+++ b/config/initializers/sass.rb
@@ -0,0 +1,13 @@
+p "** Ensuring that Sass will regenerate"
+
+# Sass fails to regenerate in production mode at an appropriate time, which
+# yields a server error (500), followed by some unstyled content.  Unsetting
+# this constant in an initializer prompts Sass to ensure that the stylesheets
+# are generated at the appropriate time.  This only applies to the initial
+# page load; subsequent requests are appropriately cached and will exhibit the
+# former behavior when provoked.
+if defined?(Sass::RAILS_LOADED)
+  module Sass
+    remove_const(:RAILS_LOADED)
+  end
+end
-- 
1.7.5.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to