rails4 + bootstrap将错误显示为“变量@ zindex-modal-background is undefined”

时间:2015-01-19 17:33:08

标签: ruby twitter-bootstrap ruby-on-rails-4 bootswatch

我试图在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

应用程序/资产/样式表/ application.css

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

应用程序/资产/ 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)

你如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

通过添加下一个代码解决了这个问题:

资产/样式表/天蓝色/ variables.less

@zindex-modal-background: 0;

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