css - 修改Rails的custom.scss.css导致报错

标签 css ruby-on-rails twitter-bootstrap

我遵循了 Michael Hartl 的教程 (http://www.railstutorial.org/),我想更改 custom.scss.css 样式表中的一些 css 函数。每当我对工作表进行任何更改时,例如,将页边距从 10 像素更改为 11 像素,我的浏览器就会出现此错误:

Sass::SyntaxError in StaticPages#home
Showing /Users/Desktop/Sample_App/app/views/layouts/application.html.erb where line #5 raised:

Undefined variable: "$gray-light".
  (in /Users/Desktop/Sample_App/app/assets/stylesheets/custom.css.scss:57)
Extracted source (around line #5): 

这是一个类似的问题:Bootstrap not working after minor change to custom.css.scss

我不明白为什么会这样。

最佳答案

您正在尝试使用未定义的 sass 变量。定义“$gray-light”或确保它所在的文件是@imported。

关于css - 修改Rails的custom.scss.css导致报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25099273/

相关文章:

ruby-on-rails - 什么时候需要在 Mongoid 中调用 self.field = ?

javascript - 验证 mouseup/keyup 上的 Bootstrap 单选按钮

html - 删除 Bootstrap 下拉列表中的白线

javascript - Uncaught Error : cannot call methods on button prior to initialization; attempted to call method 'loading'

jquery - 将 Div 定位在响应式网格之外

asp.net - 在 IE 中使用相同的 css 文件获取不同的字体大小

ruby-on-rails - 获取特定月份的第一个 beginning_of_week

html - 将容器内的分区对齐第一行的中心,但在分区转移到下一行时向左对齐

html - 在调整大小时如何使箭头的位置固定在框中?

ruby-on-rails - 如何 stub i18n_scope 以在 Rails 4 rspec 3.3.0 上模拟 ActiveRecord::RecordInvalid?