7
我有一个现有的Rails应用程序,我正在从Rails 3.0升级到Rails 3.1。所有的开发都很顺利,但是当转向生产时,我的样式表显然正在打破,显然是由于资产编译。禁用生产中的资产捆绑,Rails 3.1?
我想在生产中禁用资产编译,直到我可以得到样式表冲突解决,但配置开关我扔在它似乎没有工作。
production.rb
# Don't fallback to assets pipeline
config.assets.compile = false
# Do not compress assets
config.assets.compress = false
# Generate digests for assets URLs
config.assets.digest = false
重启客运application.css后是被服务的唯一样式表,包含了内嵌的内容。在开发环境中,我有:
development.rb
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
...这会导致几个样式表被加载,不只是application.css,并在应用程序的工作方式。
application.rb中
=stylesheet_link_tag 'application'
=javascript_include_tag 'application'
application.css
*= require flutie
*= require_self
*= require jquery-ui-1.8.14.custom.css
*= require demo_table
所有的资产都在应用程序安装/资产
嗯,感谢尼克,我在application.rb中设置config.assets_enabled为false,在production.rb中设置为true,现在即时获取完全破坏的样式表和js。说它找不到application.js和application.css –
您可以尝试更改行: config.assets.compile = false为true。这将编译任何样式表或JavaScript,只要有遗漏。 – Nick
已设置为false。 #不要退回到资产管道 config.assets.compile =假 #不压缩资产 config.assets.compress =假 #生成摘要资产的URL config.assets.digest =假 #启用资产管道 config.assets.enabled = false –