jammit gem的问题

时间:2010-11-29 18:22:55

标签: ruby-on-rails-3 jammit

嗨我在rails 3中使用jammit进行js和css压缩。我收到此错误:

ActionView::Template::Error (assets.yml does not contain a "base" CSS package):
    9:  <% if @content_keywords %><meta name="keywords" content="<%= @content_keywords %>" /><% end %>
    10:  <% if @content_description %><meta name="description" content="<%= @content_description %>" /><% end %>
    11:  <meta name="robots" content="index,follow" />
    12:  <%= include_stylesheets :base %>  
    13:  <%= csrf_meta_tag %>
    14: </head>
    15: <body> 

文件assets.yml包含以下代码:

    package_assets:         on          # (on, off, always)
#embed_assets:           on          # (on, off, datauri)
compress_assets:        on          # (on, off)
gzip_assets:            on          # (on, off)
template_function:      _.template  # (defaults to the built-in micro-templating)
package_path:           packages    # (defaults to assets)
javascript_compressor:  yui    # (yui, closure)

stylesheets:
  base:
    - public/stylesheets/main_min.css

javascripts:
  base_en:
#    - public/javascripts/libs.no_min.js
    - public/javascripts/jquery.innerfade.js
    - public/javascripts/jquery.color.js
    - public/javascripts/jquery.timeago.js

1 个答案:

答案 0 :(得分:0)

请发表评论

template_function:      _.template  # (defaults to the built-in micro-templating)
package_path:           packages    # (defaults to assets)

并将资产打包到默认的“assets”目录。在此之后做一个“jammit --force”来重新生成资产。