Ruby on rails 使用savon gem制作肥皂

Ruby on rails 使用savon gem制作肥皂,ruby-on-rails,ruby,soap,savon,Ruby On Rails,Ruby,Soap,Savon,当我将其添加到我的文件时: gem 'savon', '~> 2.0' 然后运行捆绑安装。然后尝试启动一个rails控制台I出现以下错误: app/models/user.rb:6:in `include': wrong argument type Class (expected Module) (TypeError) from app/models/user.rb:6:in `<class:User>' from app/models/user.rb:3:i

当我将其添加到我的文件时:

gem 'savon', '~> 2.0'
然后运行
捆绑安装
。然后尝试启动一个
rails控制台
I出现以下错误:

app/models/user.rb:6:in `include': wrong argument type Class (expected Module) (TypeError)
    from app/models/user.rb:6:in `<class:User>'
    from app/models/user.rb:3:in `<top (required)>'
更新II(相关型号位):


savon gem的一个依赖项是uuid gem,它提供了一个
uuid

在仅按需加载应用程序代码的开发模式中,这意味着永远不会加载uuid文件,
uuid
是gem中的类

在生产环境中,rails可能会在应用程序启动时尝试加载您的文件,这取决于文件所在的位置和您的急切加载设置,您会收到一个错误,因为您正在创建一个与模块同名的类


最简单的方法是重命名您的模块——要么选择一个完全不同的名称,要么为其命名名称空间

你能显示用户模型的代码吗?@liuzxc是的,我会在一秒钟内更新。你尝试包含一个类,这在ruby中是不可能的。@liuzxc不确定你的确切意思,你在哪里看到我包含了类。对不起,我累了,不明白你的意思吗?UUID是一个模块。。
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.2.0]
class User < ActiveRecord::Base
  include InstanceMethodsOnActivation
  include GoingPostal
  include UUID
  include Wizard
  include PublicActivity::Common
module UUID
  extend ActiveSupport::Concern

  def uuid
    HASHIDS.encrypt(id)
  end

  def to_param
    uuid
  end

  module ClassMethods
    def find_by_uuid(uuid)
      self.find_by_id(HASHIDS.decrypt(uuid)) unless uuid.nil?
    end

    def find_by_uuid!(uuid)
      self.find_by_id!(HASHIDS.decrypt(uuid)) unless uuid.nil?
    end
  end
end