Forum: Ruby on Rails mailboxer error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5baf41f96424ef74ee9b4b566f424a83?d=identicon&s=25 Artene Radu (r2artene)
on 2016-05-05 10:34
Hello!

I want to make my user model act as messageable.
I added gem 'mailboxer', github: 'mailboxer/mailboxer' in the gem file.
I added 'acts_as_messageable' in the user model.

I assiged u1 = User.first
u2 = User.find_by(id: 2)
when I write the following command in console:
u1.send_message u2, "body", "subject"

I get the error:
NoMethodError: undefined method `email' for
#<Mailboxer::Message:0x00000007392c70>

Does anybody knows what can be the problem?
Thank you!
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2016-05-05 12:22
(Received via mailing list)
On 5 May 2016 at 09:34, Artene Radu <lists@ruby-forum.com> wrote:
>
> I get the error:
> NoMethodError: undefined method `email' for
> #<Mailboxer::Message:0x00000007392c70>

Did you follow all the instructions here:
https://github.com/mailboxer/mailboxer

Also why are you installing direct from github?  Doing that gives you
the latest development version rather than the released version.

Colin
This topic is locked and can not be replied to.