代码之家  ›  专栏  ›  技术社区  ›  maček

如何在/tmp目录中缓存HAML文件?

  •  0
  • maček  · 技术社区  · 14 年前

    我对HAML有一个问题,它试图写入一个只读文件系统(在Heroku部署的应用程序上)。

    我只能写信给你 /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'
    
    1 回复  |  直到 14 年前
        1
  •  2
  •   Jesse Wolgamott    14 年前

    就像马克说的,我想你指的是萨斯,不是哈默。这里是 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,它在第一次读取时就这样做了。