【问题标题】:Cannot disable rails assets pipeline无法禁用 Rails 资产管道
【发布时间】:2019-12-04 13:02:34
【问题描述】:

我有一个 rails '4.2.11.1' 应用程序。我想禁用资产编译,缩小,开发中的管道。为了使用indium debugger

rails 应用程序似乎设置了 sprokets。所以在我的 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

但什么也没发生,我得到了文件: 资产/stixs.self-7246a54effa0c5edaa806b9c4fbc6ba4617c0d80bef8c236f9a4cbcfcf7f0be7.js

最后我得到这些文件没有被缩小或压缩,但是我怎样才能让 rails 在开发环境中为 app/assets/javascripts 中的文件提供服务

【问题讨论】:

    标签: javascript ruby ruby-on-rails-4 asset-pipeline


    【解决方案1】:

    用于指纹识别的技术 Sprockets 是在名称中插入内容的哈希

    在你的 development.rb 中添加这个

    config.assets.digest = false
    

    我希望这对你有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-31
      • 2012-04-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-16
      • 1970-01-01
      相关资源
      最近更新 更多