首页 > 代码库 > Images and assets not working in production server
Images and assets not working in production server
Here are a few problems that you might be having:
1 - Your production configuration may not be correct. This is particularly likely if you started out with an early 3.1 release candidate, and have been updating along the way. The suggested options for production.rb changed quite a bit between rc4 and the 3.1.0 release.
Make sure that your production.rb settings include:
# Disable Rails‘s static asset server (Apache or nginx will already do this)config.serve_static_assets = false# Don‘t fallback to assets pipeline if a precompiled asset is missedconfig.assets.compile = false# Generate digests for assets URLsconfig.assets.digest = true
2 - You may have forgotten to precompile your assets
RAILS_ENV=production rake assets:precompile
3 - You may have forgotten to restart your web server to pick up the changes in production.rb.
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。