簡體   English   中英

無法禁用Rails資產管道

[英]Cannot disable rails assets pipeline

我有一個Rails“ 4.2.11.1”應用程序。 我要禁用資產的編譯,最小化,開發中的管道。 為了使用銦調試器

Rails應用似乎已安裝了sproket。 所以在我的config / application.rb中,我更改為:

# Enable the asset pipeline
config.assets.enabled = false

同樣在config / environmetns / development.rb中,我有以下設置:

  # Do not compress assets
  config.assets.compress = false

  # Debug mode disables concatenation and preprocessing of assets.
  # This option may cause significant delays in view rendering with a large
  # number of complex assets.
  config.assets.debug = true
  config.serve_static_files = true
  # Adds additional error checking when serving assets at runtime.
  # Checks for improperly declared sprockets dependencies.
  # Raises helpful error messages.
  config.assets.raise_runtime_errors = true

但沒有任何反應,我得到了以下文件:assets / stixs.self-7246a54effa0c5edaa806b9c4fbc6ba4617c0d80bef8c236f9a4cbcfcf7f0be7.js

最終,我得到的文件沒有縮小或壓縮,但是如何在開發環境中的應用程序/資產/ javascripts中提供文件服務呢?

Sprockets用於指紋識別的技術是將內容的哈希值插入名稱中

將此添加到您的development.rb

config.assets.digest = false

希望對您有用。

暫無
暫無

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

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