以非线程安全的方式'sass' [英] 'sass' in a non thread-safe way

查看:44
本文介绍了以非线程安全的方式'sass'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Rails 3.1 rc1 中尝试使用 sass 时收到这些警告.

I'm getting these warnings when trying to use sass in Rails 3.1 rc1.

WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
WARN: tilt autoloading 'sass/plugin' in a non thread-safe way; explicit require 'sass/plugin' suggested.

这是我的 Gemfile.

This is my Gemfile.

gem "rails", "~> 3.1.0.rc1"
gem "haml"
gem "sass"

我尝试在包含此代码的 config/initializers 中创建一个名为 sass.rb 的文件.

I've tried to create a file called sass.rb inside the config/initializers containing this code.

require "sass"

将 Gemfile 更改为此.

Changing the Gemfile to this.

gem "rails", "~> 3.1.0.rc1"
gem "haml"
gem "sass", require: false

但警告仍然存在.有大佬知道怎么解决吗?

But the warnings remains. Anyone knows how to solve it?

我找到了代码,它正在打印警告,如果有帮助的话.

I found the code that is printing the warnings, if that is to any help.

推荐答案

您是否尝试过在 Gemfile 中执行此操作?

have you tried doing this in Gemfile?

gem "sass", :require => 'sass'

这是一个显式调用,不使用初始值设定项.顺便说一下,请考虑您使用的是 rc1 版本.

this is an explicit call, without using initializers. by the way consider that you're using a rc1 release.

这篇关于以非线程安全的方式'sass'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆