根据预编译期间的Rails 3.1资产管道,Twitter引导程序有无效的CSS?

我创建了一个全新的Rails 3.1应用程序.我在app / assets / stylesheets / bootstrap.min.css中添加了twitter bootstrap CSS文件.这是相关的代码

app / assets / stylesheets / application.css(包括树,所以包含bootstrap)

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file,but it's generally better to create a new file per style scope.
 *= require_self
 *= require_tree . 
*/

Gemfile(包括用于编译/压缩的execjs和therubyracer)

group :development,:qa do
  gem 'execjs'
  gem 'therubyracer'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails','~> 3.1.0'
  gem 'coffee-rails','~> 3.1.0'
  gem 'uglifier','>= 1.0.3'
end

然后我运行rake任务来预编译资产

rake assets:precompile

这失败,出现以下错误

Invalid CSS after ".inputs-list li+": expected number or function,was "li"

CSS在引导程序文件中(“.inputs-list li li”是选择器).

但是,如果我跑

rake assets:precompile RAILS_ENV=development

现在它工作正常.事实证明,如果我将config / environments / production.rb更改为不压缩文件

config.assets.compress = false

那么原始命令也可以工作(没有指定开发环境).

那么,我该如何追踪错误?我现在可以忍受只是关闭压缩,但显然有些不对劲.是Rails吗?链轮?ruby赛车? Uglifier?

解决方法

我使用非缩小版的Bootstrap修复了这个问题.在运行rake资产时它仍然会被编译:预编译所以它不是问题:)

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效