#< Grease :: Adapter(Less :: Rails :: ImportProcessor)的未定义方法'new' [英] undefined method `new' for #<Grease::Adapter(Less::Rails::ImportProcessor)

查看:84
本文介绍了#< Grease :: Adapter(Less :: Rails :: ImportProcessor)的未定义方法'new'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新了Gemfile中的gem,并在运行"bundle"命令后开始遇到Grease :: Adapter错误.问题似乎出在我的应用程序的CSS中.

I have updated a gem in the Gemfile and started facing the Grease::Adapter error after running "bundle" command. The problem seems with the css of my application.

错误在下面给出:

NoMethodError: undefined method `new' for #<Grease::Adapter(Less::Rails::ImportProcessor):0x0000000205dfc0>

我正在使用Rails版本"4.1.8".谁能帮我解决这个问题?

I am using rails version "4.1.8". Can anyone help me how to resolve this?

推荐答案

问题已解决,这是由于更新的"less-rails" gem(v3.0.0)的油脂" gem依赖关系.

The issue was resolved and it was due to the "grease" gem dependency for updated "less-rails" gem (v3.0.0).

当我更新Gemfile中的现有gem版本并将Gemfile.lock中的"less-rails" gem版本也从"2.8.0"更新为"3.0.0"时,就会创建油脂"依赖项.

"Grease" dependency was created when I updated an existing gem version in my Gemfile which updated the "less-rails" gem version from "2.8.0" to "3.0.0" in Gemfile.lock as well.

然后,我将"less-rails"版本设置为旧版本(以前在Gemfile.lock中使用):

Then I set the "less-rails" version to the old one (previously being used in Gemfile.lock):

gem "less-rails", "~> 2.8.0"

只有"less-rails" 3.0.0及更高版本才需要添加gem依赖项,因此较低的版本并没有创建此依赖项,从而解决了该问题.

Grease gem dependency is required only for "less-rails" 3.0.0 version and above so lower version did not create this dependency which resolved the issue.

更少依赖(3.0.0)依赖项的官方页面: https://rubygems.org/gems/less-rails/versions/3.0.0

Official page for less-rails(3.0.0) dependencies: https://rubygems.org/gems/less-rails/versions/3.0.0

这篇关于#&lt; Grease :: Adapter(Less :: Rails :: ImportProcessor)的未定义方法'new'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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