资产未在生产环境中预编译

问题描述 投票:1回答:0

我试图将页面特定的CSS添加到我的Rails应用程序中。 在review_quote视图上,我要呈现review_quote.css。

到目前为止,我拥有的语法适用于开发环境,因为(我认为)资产管道尚未压缩到一个文件中。

如何在生产环境中查看特定的CSS?

这也可能是相关的:

# production.rb
config.serve_static_assets = true

使用.slim而不是.erb

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Quotes#show

Showing /app/app/views/quotes/review_quote.html.slim where line #2 raised:

review_quote.css isn't precompiled
Extracted source (around line #2):

1: - content_for :head do 
2:   = stylesheet_link_tag "review_quote", media: "all"
3: 
4: 
5: #review-quote
css ruby-on-rails asset-pipeline slim-lang
© www.soinside.com 2019 - 2024. All rights reserved.