ruby on rails - uninitialized constant Sidekiq::Worker (NameError) -
today discovered sidekiq-mailer, wonderful gem integrates sidekiq , can project. i'm having issues in installation/configuration, can me? saw related questions , none fix issue.
gem file
currently i'm using lastest version of sidekiq , lastest version of sidekiqmailer. following can check gemfile:
gem 'sidekiq' gem "sidekiq-cron" gem 'sidekiq-failures' gem 'sidekiq_mailer', git: 'https://github.com/andersondias/sidekiq_mailer.git'
i'm using gems, in different purposes / features.
files
i have 2 workers @ moment: 1 uses "sidekiq" + "sidekiq-cron" , (i think have guess) uses "sidekiq" + "sidekiq_mailer".
i have 1 personmailer, don't use "sidekiq_mailer" yet:
class personmailer < actionmailer::base default from: "no-reply@myawesomeproject.com" # templates in "views/mailers/mailer_name/method_name.html.erb" default template_path: "mailers/#{self.name.underscore}" def send_email_new_user(user) @user = user mail(to: @user.email, subject: "you = <3") end end
and call mailer way (inside personcontroller):
personmailer.send_email_new_user(user).deliver
the error
now let's talk error. after run bundle install
in terminal, can't start localhost server (rails s
). try receive following error:
/home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/bundler/gems/sidekiq_mailer-4a5881b10c2a/lib/sidekiq_mailer/worker.rb:2:in `<class:worker>': uninitialized constant sidekiq::worker (nameerror) /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/bundler/gems/sidekiq_mailer-4a5881b10c2a/lib/sidekiq_mailer/worker.rb:1:in `<top (required)>' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/bundler/gems/sidekiq_mailer-4a5881b10c2a/lib/sidekiq_mailer.rb:2:in `<top (required)>' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in `require' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in `block (2 levels) in require' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in `each' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in `block in require' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in `each' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in `require' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/bundler-1.6.5/lib/bundler.rb:132:in `require' /home/paladini/documents/programacao/myawesomeproject/config/application.rb:6:in `<top (required)>' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/railties-3.2.3/lib/rails/commands.rb:53:in `block in <top (required)>' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' /home/paladini/.rvm/gems/ruby-1.9.3-p547@myawesomeproject/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' script/rails:6:in `require' script/rails:6:in `<main>'
how can solve problem fast?
p.s: posted question github issue, here.
Comments
Post a Comment