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

主宰稳场 提交于 2019-12-11 16:15:06

问题


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.

The error is given below:

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

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


回答1:


The issue was resolved and it was due to the "grease" gem dependency for updated "less-rails" gem (v3.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.

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

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

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.

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



来源:https://stackoverflow.com/questions/46825582/undefined-method-new-for-greaseadapterlessrailsimportprocessor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!