1
votes

I'm using sidekiq with rails 5 for background jobs and I wanna deliver emails in that way too. Have the following setup on my gemfile:

gem 'redis-rails'
gem 'sidekiq'
gem 'sinatra', github: 'sinatra/sinatra', require: false
gem 'devise-async'

I have also set the initializer:

Devise::Async.backend = :sidekiq

And call my mailer method like:

Mailer.delay.signup_email(@user, @password)

On sidekiq log, I get the error

2016-10-26T19:02:09.473Z 17854 TID-ww0i8 WARN: ArgumentError: undefined class/module Mailer

my mailer.rb file is on app/mailers folder. I restarted my rails server, redis server, sidekiq and I still get the error. Anyone knows how to fix it? thanks!

1

1 Answers

0
votes

Mailer is a really bad name for the class and may not autoload for that reason. Give it a more specific name, UserMailer or such, and move it to user_mailer.rb.