【问题标题】:RoR App: “The asset 'application.css' is not present in the asset pipeline”RoR 应用程序:“资产管道中不存在资产‘application.css’”
【发布时间】:2023-03-27 14:51:01
【问题描述】:

信息: 导轨 6.1.4 红宝石 3​​.0.1 PostgreSQL 9.6 NodeJS 11.15.0 纱线 1.22.5

当我启动我的应用程序时,我总是遇到同样的错误:

我已经尝试了我在其他帖子中看到的所有内容,但我无法解决这个问题。 有什么建议吗?

【问题讨论】:

  • 您的app/assets/stylesheets 上有application.css 吗?
  • 检查您的application.css 加载或不使用网址:http://localhost:3000/assets/application.css
  • 是的,application.css 在 app/assets/stylesheets 中,但我无法使用 url 访问。当我尝试访问时收到此错误:“您要查找的页面不存在。”

标签: node.js ruby-on-rails unicorn


【解决方案1】:

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了。

【讨论】:

    猜你喜欢
    • 2019-11-07
    • 1970-01-01
    • 2017-12-27
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 2021-09-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多