本文介绍了Rails3和Sass :: Plugin :: options的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将Sass::Plugin.options[:style] = :compact添加到environment.rb

When I try to add Sass::Plugin.options[:style] = :compact to environment.rb

当我尝试启动服务器时,我得到:

When I try to start up my server I get:

我已将gem 'haml', '3.0.0'添加到我的 Gemfile 中.

有人碰到这个吗?

推荐答案

我尝试了您描述的内容,对我来说效果很好.我正在使用最新版本的haml 3.0.4.您可能要在系统上运行gem update haml,然后重试.从3.0.0到3.0.4的更改列表位于 http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html

I tried what you described and it worked fine for me. I'm using haml 3.0.4 which is the latest version. You may want to run a gem update haml on your system and try again. The list of changes from 3.0.0 to 3.0.4 are at http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html

我还建议不要将其放在您的environment.rb中,而是创建一个config/initializers/sass_config.rb文件并将您的SASS配置放在此处.我的看起来像这样:

I also suggest not putting this in your environment.rb, but instead create a config/initializers/sass_config.rb file and put your SASS config there. Mine looks like this:

Sass::Plugin.options[:property_syntax] = :old
Sass::Plugin.remove_template_location("./public/stylesheets/sass")
Sass::Plugin.add_template_location("./app/stylesheets")

这篇关于Rails3和Sass :: Plugin :: options的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 23:34