Padrino、compass 和 heroku 的只读文件系统

发布于 2024-09-12 22:11:47 字数 919 浏览 6 评论 0原文

我真的很喜欢 padrino 与指南针“正常工作”的方式,但我有几个问题,因为我将使用 heroku (以及他们的只读文件系统 ) 用于托管

  1. 从表面上看,如果对 sass 文件进行了更改并且用户访问了服务器,padrino/compass 组合只会编译 sass。 这是真的吗?

  2. 如果是这样,那么我的想法是否正确,一旦应用程序处于生产模式,我就不必担心指南针尝试写入文件系统,因为我当我的 sass 文件位于服务器上时,不会对它们进行任何更改?

  3. 除了对 sass 文件进行更改之外,是否还有其他情况会导致 padrino/compass 写入文件系统?

  4. 如果我在问题 2 中所做的假设是错误的,那么如何防止 padrino/compass 写入文件系统?

Nathan Weizenbaum(因 Sass 而闻名)建议我使用 Sass ::Plugin::Rack,当组合 sinatra、sass、compass 和 heroku 时,但经过深思熟虑,我决定最好的选择(至少满足我的需要)是通过链接来阻止 sass 进行任何类型的服务器端编译到我的静态CSS文件而不在我的路线中调用sass

我注意到compass_plugin.rb(由padrino生成器创建)需要“Sass:Plugin::Rack”

我将无法推送到heroku直到明天晚上,所以我试图了解我可能遇到的任何问题

[我会在 padrino 邮件中问同样的问题]

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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

网名女生简单气质 2024-09-19 22:11:47

padrino 上找到了答案解决此问题的邮件列表

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

# right before
Compass.configure_sass_plugin!
Compass.handle_configuration_change! 

它对我有用

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

梓梦 2024-09-19 22:11:47

我有一个使用 Rails 和 Compass 的新项目,每次我推送到 heroku 时,compass 似乎都会尝试写入文件系统。每次更新后访问该页面时,我都会收到“我们很抱歉,但出了点问题”警告。

尽管所有 css 文件都应该已经存在,但还是会发生这种情况。路过奇怪。

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.

耳钉梦 2024-09-19 22:11:47

Heroku 最近发布了一篇名为 在 Heroku 上使用 Compass 的博客文章,鼓励用户使用 tmp 目录用于编译样式表。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文