0

I am using mailboxer in my Rails 4 app.

gem 'mailboxer'

I recently updated it from 0.11 to 0.12.4, it stopped working, and I cant figure out why. Now, I am getting the error:

uninitialized constant Message

I checked the gem's GitHub repo and it does have the Message model.

I checked my local version of the gem and it matches up.

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

Why isn't my app finding the model? How do I fix this?

Jeff
  • 13,943
  • 11
  • 55
  • 103

1 Answers1

1

Message is now namespaced as Mailboxer::Message. According to the upgrade documentation, you also need to run through a few steps when upgrading from 0.11 to 0.12:

rails generate mailboxer:namespacing_compatibility
rails generate mailboxer:install -s
rake db:migrate
infused
  • 24,000
  • 13
  • 68
  • 78
  • I noticed and ran the migrations but they didn't solve the problem for me, but I didn't notice the namespace change. I had do move some views around and it started working again. Thanks for the point in the right direction. – Jeff Sep 10 '14 at 14:36
  • @Jeff can you post your solution please I am having a similar issue with Notification – Jeff Finn Nov 15 '14 at 19:52
  • @JeffFinn I moved some of the views into a subfolder in the `app/views` folder. I dont remember exactly which move fixed the error, but if I go back in my repo history, I created a few new folders that day... `app/views/mailboxer/conversations` (I think this was the one), `app/views/message_mailer` and `app/views/notification_mailer`. – Jeff Nov 17 '14 at 18:46