开发模式中未发生Rails erb预处理 [英] Rails erb preprocessing not happening in development mode
本文介绍了开发模式中未发生Rails erb预处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无论出于何种原因,这种对动态样式的首次尝试都在下面的行中为我提供了Sass :: SyntaxError.看来erb尚未进行预处理.
For whatever reason, this first attempt at dynamic styling gets me a Sass::SyntaxError on the line below. It looks like the erb is not being pre-processed.
/* app/assets/stylesheets/variables.css.scss.erb */
$headerHeight: <%= '15px' %>;
它处于开发模式.知道是什么原因造成的吗?
It's in development mode. Any idea what could cause this?
以下是与资产相关的我的配置选项,以帮助您:
Here are my configuration options relating to assets in case that helps:
# Application
config.assets.enabled = true
config.assets.initialize_on_precompile = true
config.assets.version = '1.1'
# Development
config.assets.compress = false
config.assets.debug = false
推荐答案
scss需要在15px部分周围加引号.因此,您需要做到:
The scss needs quotes around the 15px part. So you will need to make it:
$headerHeight: "<%= '15px' %>";
这篇关于开发模式中未发生Rails erb预处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文