0

嗨,我在 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
4

1 回答 1

0

请评论

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

并让资产打包到默认的“资产”目录。在此之后执行“jammit --force”以重新生成资产。

于 2011-01-30T05:02:05.343 回答