问题描述
在加载网页时,我收到了由Phusion发出的以下错误:
尝试加载宝石'指南针轨道'。
Gem Load Error是:对于Sass :: Util:模块
有未定义的方法`has?'您的意思是?散列
散列
用于宝石加载错误的Backtrace是:
/Volumes/Data/htdocs/zetcho/vendor/bundle/gems/compass-0.12.2/lib/compass/sass_extensions/functions/ urls.rb:5:in`has?'
指定位置的代码是:
模块Compass :: SassExtensions :: Functions :: Urls
def self.has? (base,instance_method)
Sass :: Util.has?(:instance_method,base,instance_method)
end
我的gem文件包含:
#Bundle edge Rails改为:gem'rails',github: 'rails / rails'
gem'rails','〜> 5.1.2'
#使用mysql作为活动记录的数据库
gem'mysql2','〜> 0.3.18'
#在样式表中使用SCSS
gem'sass-rails','〜> 5.0'
#将Compass用于样式表
gem'compass-rails'
#使用Compass扩展名susy
gemsprockets
gem'susy'
我刚刚使用Rails 5.1.2创建了Ruby on Rails网站,红宝石2.3.1。我有一个很老的网站,可以很好地与宝石。我是否错过了整体安装的一个步骤,或者这是一个使用compass-rails的bug?
当我尝试添加控制器时,出现同样的错误:
rails generate controller home index
经过更多的挖掘,我发现了一个类似的问题。我通过将gem文件更改为:
gem'compass-rails',github:'Compass / compass-rails '
然后:
rm gemfile.lock
包
I get the following error issued by Phusion when loading a web page:
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?'
The code at the indicated location is:
module Compass::SassExtensions::Functions::Urls
def self.has?(base, instance_method)
Sass::Util.has?(:instance_method, base, instance_method)
end
My gem file contains:
# 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'
I've just created the Ruby on Rails site using Rails 5.1.2 and ruby 2.3.1. I have a much older site that works fine with the gem. Did I miss a step in the overall install or is this a bug with compass-rails?
I got the same error when I tried to add a controller:
rails generate controller home index
After more digging around, I found a similar problem. I fixed this one by changing the gem file to:
gem 'compass-rails', github: 'Compass/compass-rails'
Then:
rm gemfile.lock
bundle
这篇关于Phusion错误:未定义的方法`有?'对于Sass :: Util:模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!