ruby-on-railsrubyrubygemsmailboxer

Unknown key: :order in Mailboxer Gem


I am currently trying to use the Mailboxer Gem. I have added the following line in my Gemfile:

gem "mailboxer"

In the konsole I did these:

$ bundle install
$ rails g mailboxer:install
$ rake db:migrate
$ rails g mailboxer:views

and have added acts_as_messageable in my user.rb. However, I am getting this error

enter image description here

I tried replacing the gem in Gemfile from gem 'mailboxer'' to gem 'mailboxer', github: 'mailboxer/mailboxer' but I get this message when I bundle install

git://github.com/mailboxer/mailboxer.git (at master@0e41d6a) is not yet checked out. Run `bundle install` first.

How can I fix this and make the mailboxer work in my rails application?


Solution

  • I figured out that I should add the following methods in user.rb besides the line acts_as_messageable:

      acts_as_messageable
    
      def name 
        self.name
      end 
    
      def mailboxer_email(object)
        nil
      end 
    

    I used the following for the Gemfile:

    gem 'mailboxer', '~> 0.14.0'
    

    The two errors I had from previous tries are now gone.