gpt4 book ai didi

sprockets - Assets application.css 未声明,但在 list 中声明

转载 作者:行者123 更新时间:2023-12-04 11:19:55 31 4
gpt4 key购买 nike

我收到此错误:

ActionView::Template::Error (Asset `application.css` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.

//= link application.css
and restart your server):
  • 导轨 5.1.4
  • sprockets (4.0.0.beta5, 4.0.0.beta4, 3.7.1)
  • sprockets 导轨 (3.2.1, 3.2.0, 2.3.3)

  • Manifest.js
    //= link_tree ../images

    //= link_directory ../javascripts .js

    //= link_directory ../stylesheets .css

    Assets .rb
    # Be sure to restart your server when you modify this file.

    # Version of your assets, change this if you want to expire all your assets.
    Rails.application.config.assets.version = '1.0'

    # Add additional assets to the asset load path.
    # Rails.application.config.assets.paths << Emoji.images_path
    # Add Yarn node_modules folder to the asset load path.
    Rails.application.config.assets.paths << Rails.root.join('node_modules')

    # Precompile additional assets.
    # application.js, application.css, and all non-JS/CSS in the app/assets
    # folder are already added.
    # Rails.application.config.assets.precompile += %w( admin.js admin.css )

    申请.rb
    require_relative 'boot'

    require "rails"
    # Pick the frameworks you want:
    require "active_model/railtie"
    require "active_job/railtie"
    # require "active_record/railtie"
    require "action_controller/railtie"
    require "action_mailer/railtie"
    require "action_view/railtie"
    require "action_cable/engine"
    require "sprockets/railtie"
    require "rails/test_unit/railtie"

    最佳答案

    更改重命名后也得到了这个application.cssapplication.scss .

    修复很简单,只需让你的 manifest.js 文件看起来像这样:

    //= link_tree ../images
    //= link application.css

    重新启动服务器,希望能解决它。
    祝你好运。

    关于sprockets - Assets application.css 未声明,但在 list 中声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46391220/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com