簡體   English   中英

RoR 應用程序:“資產‘application.css’不存在於資產管道中”

[英]RoR App: “The asset 'application.css' is not present in the asset pipeline”

信息:Rails 6.1.4 Ruby 3.0.1 PostgreSQL 9.6 NodeJS 11.15.0 Yarn 1.22.5

當我啟動我的應用程序時,我總是遇到同樣的錯誤: 在此處輸入圖像描述

我已經嘗試了我在其他帖子中看到的所有內容,但我無法解決這個問題。 有什么建議么?

config/environments/production.rb我添加了以下行:

# Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = true

我還檢查了以下行:

config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 

有了這個配置我就可以啟動我的APP了。

您是否嘗試在服務器上執行以下操作

RAILS_ENV=production bundle exec rake assets:precompile

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM