根据documentation设置所有项目后,我在尝试运行服务器时遇到此错误:
/gems/ruby-2.3.3@r426/gems/activerecord-4.2.6/lib/active_record/dynamic_matchers.rb:26:in
method_missing': undefined method
has_attachment'对于用户(电话 ' User.connection'建立连接):Class(NoMethodError)
我生成了所有文件,并将require "attachinary/orm/active_record"
包含在ApplicationController
。
我还包括路线:mount Attachinary::Engine => "/attachinary"
并运行所有迁移。
#model
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
extend FriendlyId
friendly_id :name, use: :slugged
has_attachment :avatar, accept: [:jpg, :png, :gif]
validates :avatar, presence: true
has_many :authors
has_many :posts, through: :authors
end
有没有人遇到过这个问题?