我的设置是相当简单的默认导轨3.2.1设置。 我所有的.css.sass文件都在/app/assets/stylesheets/ 。 我有sass-rails '~> 3.2.3'宝石:assets组。
没有application.css,只有main.css.sass (用于主布局)。
当我发出:
RAILS_ENV=production bundle exec rake assets:precompile它编译我的咖啡脚本和JavaScript。 日志中没有错误消息。 它就像它甚至不尝试编译sass文件。
main.css.sass文件头看起来像这样:
//=depend_on "_globals.css.sass" @import globals_glocals.css.sass存在于同一个目录中。
My setup is fairly simple default rails 3.2.1 setup. All my .css.sass files are in /app/assets/stylesheets/. I have the sass-rails '~> 3.2.3' gem in :assets group.
There's no application.css, just main.css.sass (used for main layout).
When i issue:
RAILS_ENV=production bundle exec rake assets:precompileit compiles my coffeescripts and javascripts. There are no error messages in the log. It's like it doesn't even try to compile sass files.
The main.css.sass file header looks like this:
//=depend_on "_globals.css.sass" @import globalsThe _glocals.css.sass exists in the same directory.
最满意答案
詹姆斯是对的,这是可能的解决方案之一。
将所有文件添加到一个清单文件的缺点是所有文件都会预编译为单个文件 - 这并不总是您想要的。
在我的情况下,我需要单独的文件(每个布局一个文件)。
如何添加新的清单文件:
config.assets.precompile += %w( file1.css file2.css )你不需要有实际的file1.css ,如果你有file1.css.sass ,它将被预编译。
James is right and it's one of the possible solutions.
The drawback of adding all files to one manifest file is that all will be precompiled to single file - which isn't always what you want.
In my case I needed separate files (one file for each layout).
Heres how to add new manifest files:
config.assets.precompile += %w( file1.css file2.css )You don't need to have actual file1.css, if you have file1.css.sass it will be precompiled.
更多推荐
发布评论