application.css不起作用

时间:2012-02-05 21:33:23

标签: ruby-on-rails

这是我的application.css:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * 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 bootstrap 
 *= require bootstrap-responsive 
 *= require style 

由于某些原因,我的css样式都没有被应用。当我查看源代码并打开application.css时,该文件完全相同。它没有编译它。 application.js编译得很好!

我的宝石文件:https://gist.github.com/1748054

有什么想法吗?

编辑:通过添加*/

修复此问题

1 个答案:

答案 0 :(得分:0)

确保您拥有:

# Enable the asset pipeline
config.assets.enabled = true

config/application.rb

中设置

这也是在黑暗中拍摄的一点但是你不需要像这样的一行:

*=require_self

之前的事情。我总是使用sass导入来包含更精确的样式表。所以我的看起来像这样:

/*
 *= require_self
 */
@import "bootstrap.css";
@import "bootstrap-responsive.css";
@import "style.css";

然后确保您的文件名为application.css.scss