我在我的Rails 4应用中使用mailboxer。
gem 'mailboxer'
我最近将其从0.11
更新为0.12.4
,它停止了工作,我无法弄清楚原因。现在,我收到了错误:
uninitialized constant Message
我检查了宝石的GitHub repo,它确实有Message
模型。
我检查了我的本地版本的宝石,它匹配。
Puma:mailboxer Jeff$ pwd /Users/Jeff/.rvm/gems/ruby-2.0.0-p247/gems/mailboxer-0.12.4/app/models/mailboxer Puma:mailboxer Jeff$ ls conversation conversation.rb mailbox.rb message.rb notification.rb receipt.rb
为什么我的应用找不到该型号?我该如何解决这个问题?
答案 0 :(得分:1)
Message
现已命名为Mailboxer::Message
。 According to the upgrade documentation,从0.11升级到0.12时,您还需要执行几个步骤:
rails generate mailboxer:namespacing_compatibility
rails generate mailboxer:install -s
rake db:migrate