gpt4 book ai didi

ruby-on-rails - Phusion错误:Sass::Util:Module的未定义方法 `has?'

转载 作者:行者123 更新时间:2023-12-04 05:49:44 25 4
gpt4 key购买 nike

加载网页时,我收到了Phusion发出的以下错误消息:

There was an error while trying to load the gem 'compass-rails'.
Gem Load Error is: undefined method `has?' for Sass::Util:Module
Did you mean? hash
Hash
Backtrace for gem load error is:
/Volumes/Data/htdocs/zetcho/vendor/bundle/gems/compass-0.12.2/lib/compass/sass_extensions/functions/urls.rb:5:in `has?'

指定位置的代码是:
module Compass::SassExtensions::Functions::Urls


def self.has?(base, instance_method)
Sass::Util.has?(:instance_method, base, instance_method)
end

我的gem文件包含:
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.2'

# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.18'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'

# Use Compass for stylesheets
gem 'compass-rails'

# Use the Compass extension susy
gem "sprockets"
gem 'susy'

我刚刚使用Rails 5.1.2和ruby 2.3.1创建了Ruby on Rails站点。我有一个较老的网站,可以很好地配合gem。我是否错过了总体安装的步骤,或者这是罗盘 rails 的错误?

尝试添加 Controller 时出现相同的错误:
rails generate controller home index

最佳答案

经过更多的挖掘,我发现了类似的问题。我通过将gem文件更改为以下内容来修复了该问题:

gem 'compass-rails', github: 'Compass/compass-rails'

然后:
rm gemfile.lock
bundle

关于ruby-on-rails - Phusion错误:Sass::Util:Module的未定义方法 `has?',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45269621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com