image_path没有指纹

时间:2015-06-08 09:24:16

标签: ruby-on-rails asset-pipeline

当我使用image_path ("something")时,响应没有指纹。 (预期something-1y7asdft786f78as.png) 但是当我使用javascript_include_tag时,会显示指纹。

我用Google搜索并找出config.assets.digest = trueconfig.assets.compile = true。首先不要工作。秒数的速度非常慢。

谁知道什么是错的?

# Be sure to restart your server when you modify this file.
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.1'

# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w( twitter/bootstrap/* ZeroClipboard.swf )

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = 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

  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
  # yet still be able to expire them through the digest params.
  config.assets.digest = true

2 个答案:

答案 0 :(得分:0)

我遇到了类似的问题,请尝试:

background-image: asset-data-url('something.png');

答案 1 :(得分:0)

我忘了我添加了资产/ zeroclipboard.min.js文件。所以zeroclipboard-rails宝石发生了冲突。

简单地说,我从zeroclipboard.min.js删除了assets/zeroclipboard.min.js文件。问题解决了。