rails4 + bootstrap 将错误显示为 "variable @zindex-modal-background is undefined"

rails4 + bootstrap displays the error as "variable @zindex-modal-background is undefined"

我正在尝试在 rails4.1.6 上创建使用 bootstrap 的项目。

这是 gemfile:

gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootswatch-rails', '~> 3.1.1'
gem 'twitter-bootswatch-rails-helpers'

$ bundle install 成功了。

和 bootswatch 的设置

$ rails g bootswatch:install cerulean
$ rails g bootswatch:import cerulean
$ rails g bootswatch:layout cerulean

app/assets/stylesheet/application.css

*= require cerulean/loader
*= require cerulean/bootswatch

app/assets/javascript/application.js

//= require cerulean/loader
//= require cerulean/bootswatch

但是 $ rails s 当我查看该站点时,出现以下错误:

variable @zindex-modal-background is undefined
 (in /Users/ko2ic/sample/app/assets/stylesheets/cerulean/loader.css.less)

你是怎么解决的呢?

已通过添加下一个代码解决:

assets/stylesheets/cerulean/variables.less

@zindex-modal-background: 0;

参考: http://github.com/scottvrosenthal/twitter-bootswatch-rails/issues/30