Rails 3.1资产管道-为什么我的图像无法预编译用于生产? [英] Rails 3.1 Asset pipeline - Why my images do not precompile for production?
本文介绍了Rails 3.1资产管道-为什么我的图像无法预编译用于生产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行时:
rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
所有内容都会预编译,但我的/app/assets/images/*
Everything precompiles but not my /app/assets/images/*
我什至尝试将其添加到我的environment/production.rb
I even tried adding this to my environment/production.rb
config.assets.paths << "#{Rails.root}/app/assets/images"
怎么了?谢谢!
推荐答案
找到了解决方案:Add to environment/production.rb
config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif]
为什么不是默认值;如此行所示:(已经添加了application.js,application.css和所有非JS/CSS)
Why isn't this default ;ike this line says: (application.js, application.css, and all non-JS/CSS are already added)
这篇关于Rails 3.1资产管道-为什么我的图像无法预编译用于生产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文