【问题标题】:How to cache HAML files in /tmp directory?如何在 /tmp 目录中缓存 HAML 文件?
【发布时间】:2010-10-03 10:29:47
【问题描述】:

我在尝试写入只读文件系统(在 Heroku 部署的应用程序上)时遇到了 HAML 问题。

我只能写信给/tmp/log。如何配置 HAML 将文件写入/tmp 目录?

谢谢!


编辑:

实际错误的输出

Started GET "/" for <ip> at Sun Oct 03 13:19:42 -0700 2010
  Processing by WelcomeController#index as HTML
Rendered welcome/index.html.haml within layouts/application (5.6ms)
Completed   in 10ms

ActionView::Template::Error (Read-only file system - /disk1/home/slugs/305306_d9977a4_8922/mnt/public/stylesheets/.permissions_check.23729009697080.19743.369932 - Heroku has a read-only filesystem.  See http://docs.heroku.com/constraints#read-only-filesystem):
    3: %html
    4:   %head
    5:     %title= title
    6:     = stylesheet_link_tag "reset", "application", "grid", :cache => "base"
    7:     = javascript_include_tag :defaults
    8:     = csrf_meta_tag
    9:     
  app/views/layouts/application.html.haml:6:in `_app_views_layouts_application_html_haml___661334860_23729045526060_0'

【问题讨论】:

  • 只是为了检查,你不是说sass吗?
  • 我只有静态的.css 文件。有没有办法可以查看这是否是 SASS 问题?

标签: ruby-on-rails ruby-on-rails-3 heroku haml


【解决方案1】:

就像 Mark 评论的那样,我认为您的意思是 SASS,而不是 Haml。这里是how to use git commit-hooks to precompile your SASS before deploying to heroku

编辑:发布完整错误后

改变

= stylesheet_link_tag "reset", "application", "grid", :cache => "base"

= stylesheet_link_tag "reset", "application", "grid"

缓存不是 HAML,而是 RAILS,它在第一次读取时执行此操作。

【讨论】:

  • 我只有静态的.css 文件。有没有办法可以查看这是否是 SASS 问题?
  • haml 试图写入的文件在路径中有组件/stylesheets/
  • @macek 和 @justice -- 我更新了我的答案。我认为尝试将所有样式表缓存到一个文件中是一个 RAILS 问题。在heroku上不能这样做。
猜你喜欢
  • 1970-01-01
  • 2013-09-04
  • 1970-01-01
  • 2011-04-05
  • 1970-01-01
  • 2011-09-10
  • 1970-01-01
  • 2015-03-15
  • 1970-01-01
相关资源
最近更新 更多