我有点疯了。
我在两个环境中有两个服务器(heroku,相同的配置)(分阶段,生产)。
暂存按需编译我的/资产/模板,并无问题地缓存它。产品将未编译的文件用作html (是haml标记)。
问题是:这两个环境的配置是相同的(除了邮件服务器)。
Gems、环境配置和yml是相同的。
有什么想法吗?
更新:
在这两台服务器上“预编译”的haml资产,但是原始的。暂存并没有导致文件丢失和重新编译,因为在为生产而编译的资产中。
现在,我不得不用initialize_on_precompile false将haml添加到资产编译管道。
staging.rb / production.rb
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.static_cache_control = "public, max-age=2592000"
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.assets.precompile += %w( jquery.js modernizr+respond.js polyfills.js )
config.assets.precompile += %w( gp.js ad.js richmarker.js infobox.js )
config.assets.css_compressor = :yui
config.assets.js_compressor = :uglifier
config.assets.compress=true
config.threadsafe! unless $rails_rake_task
config.i18n.fallbacks = true
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO')
config.active_support.deprecation = :notify
config.action_dispatch.rack_cache = {
:metastore => Dalli::Client.new,
:entitystore => 'file:tmp/cache/rack/body',
:allow_reload => false
}
Haml::Template.options[:ugly] = true发布于 2014-01-07 20:40:33
解决办法是把哈姆加到负载中。将以下内容添加到application.rb
Sprockets.register_engine '.haml', Tilt::HamlTemplatehttps://stackoverflow.com/questions/16958352
复制相似问题