compass and padrino on heroku

37 views
Skip to first unread message

stephen murdoch

unread,
Aug 3, 2010, 8:47:28 PM8/3/10
to Padrino Framework
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 it's in production
mode as I won't be making any changes to my sass files once 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 (http://groups.google.com/
group/compass-users/browse_thread/thread/e5f3fe82436b704c) 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

Wynn Netherland

unread,
Aug 4, 2010, 10:29:26 AM8/4/10
to pad...@googlegroups.com
Hi, Stephen,

I'm not sure how the default compass/padrino implementation goes, but
I tend to prefer to use 'compass watch' when I'm dealing with Heroku
and just avoid any needless complexities with Padrino/Rails/etc.

-- Wynn

orlin

unread,
Aug 12, 2010, 11:27:30 AM8/12/10
to Padrino Framework
I was having problems with Heroku - telling me it can't write the css
(to its read-only-fylesystem) even with none of the sass having
changed. I wasn't even accessing the page whose sass (something) was
trying to recompile... One solution is:

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

# right before

Compass.configure_sass_plugin!
Compass.handle_configuration_change!

I haven't tried Hassle since the gem is stale and bundling from :git
causes errors with heroku's bundler rc.2 right now. Anyway, I like to
see the design changes I make (reloading with livereload or xrefresh),
at which point the css recompiles. Compass watch is probably better
(as it recompiles everything?) but I haven't looked into how to give
it Pardino's directory structure (and stylesheet subfolders)...

In any case, running tests should recompile the stylesheets - wouldn't
it?

Orlin

stephen murdoch

unread,
Aug 25, 2010, 11:52:22 AM8/25/10
to Padrino Framework
thanks a lot for this Orlin - it works fine now.

Regds
Steve

On Aug 12, 4:27 pm, orlin <orlin.mo...@gmail.com> wrote:
> I was having problems with Heroku - telling me it can't write the css
> (to its read-only-fylesystem) even with none of the sass having
> changed.  I wasn't even accessing the page whose sass (something) was
> trying to recompile...  One solution is:
>
>     if Padrino.env == :production
>       Sass::Plugin.options[:never_update] = true
>     end
>
> # right before
>
>    Compass.configure_sass_plugin!
>    Compass.handle_configuration_change!
>
> I haven't tried Hassle since the gem is stale and bundling from :git
> causes errors with heroku's bundler rc.2 right now.  Anyway, I like to
> see the design changes I make (reloading with livereload or xrefresh),
> at which point the css recompiles.  Compasswatch is probably better
Reply all
Reply to author
Forward
0 new messages