我收到以下错误:Rails 3.1不预编译未被CSS引用的图像?
Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Photos#edit
Showing .../app/views/photos/_form.html.haml where line #49 raised:
taxonomy/focus-building.jpg isn't precompiled
Extracted source (around line #49):
46: = focus.code
47: .tooltip
48: %span.name= focus.name
49: = image_tag("taxonomy/focus-#{focus.code.downcase.dehumanize}.jpg")
50: /Help Overlay
51: .help
52: %a.overlay{:href=>"#", :rel=>'#help-focus'} Learn more about focus
该图像文件位于app/assets/images/taxonomy/focus-building.jpg
。我已经运行了rake assets:precompile RAILS_ENV=production
,但据我所知图像没有被复制到public/assets
目录。
奇怪的是,在SCSS中使用image-url()
引用的所有资产都正常工作。为什么在使用image_tag
时未对此图像报告进行预编译?
你在使用Rails 3.1.1或3.1.0吗? – Christos
我在轨道上3.1.1 – Andrew
我在此上添加+1。我在Rails 3.1.3上,并且遇到同样的问题。我即将准备好冲击资产管道。 –