我试图在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)
你如何解决这个问题?
答案 0 :(得分:1)
通过添加下一个代码解决了这个问题:
资产/样式表/天蓝色/ variables.less
@zindex-modal-background: 0;
参考: http://github.com/scottvrosenthal/twitter-bootswatch-rails/issues/30