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

时间:2010-10-03 10:29:48

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

我遇到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 个答案:

答案 0 :(得分:2)

像马克评论的那样,我认为你的意思是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,它在第一次读取时执行此操作。