ActiveSupport 无法在 Rails 2.3.4 下加载 Sass 引擎
我正在尝试在控制器中使用 Sass 引擎,如这篇博客文章中所示。但是 Rails (2.3.4) ActiveSupport 由于错误而无法加载它:
ArgumentError (Anonymous modules have no name to be referenced by):
haml (3.0.25) lib/sass/script/color.rb:19
haml (3.0.25) lib/sass/script/literal.rb:10
haml (3.0.25) lib/sass/script/string.rb:1
haml (3.0.25) lib/sass/script/operation.rb:2
haml (3.0.25) lib/sass/script.rb:5
haml (3.0.25) lib/sass/engine.rb:22
app/controllers/stylesheets_controller.rb:1
这是 Sass::Script::Color
中的代码
class << self; include Haml::Util; end
我已经尝试过最新的 Haml 版本和 2.2 版本。 24 具有相同的结果。有兼容版本吗?是我这边有问题吗?
I'm trying to use Sass engine in a controller like in this blog post. But Rails (2.3.4) ActiveSupport can't load it because of an error:
ArgumentError (Anonymous modules have no name to be referenced by):
haml (3.0.25) lib/sass/script/color.rb:19
haml (3.0.25) lib/sass/script/literal.rb:10
haml (3.0.25) lib/sass/script/string.rb:1
haml (3.0.25) lib/sass/script/operation.rb:2
haml (3.0.25) lib/sass/script.rb:5
haml (3.0.25) lib/sass/engine.rb:22
app/controllers/stylesheets_controller.rb:1
Here's the code in Sass::Script::Color
class << self; include Haml::Util; end
I've tried with the latest Haml version and also version 2.2.24 with the same result. Is there a compatible version? Is there a problem on my side?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,这很愚蠢,
Sass::Script::Color
文件不需要Haml::Util
,所以我必须自己做:Finally it was quite stupid, the
Sass::Script::Color
file wasn't requiringHaml::Util
, so I had to do it myself: