Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method `async' (suckerpunch gem)

I am using sucker_punch gem to send the email in my rails app in the background.It used to work fine, but then I suddenly got this error:

undefined method `async' for #<ActiveJob::QueueAdapters::SuckerPunchAdapter::JobWrapper:0x007f892c6c31a0>

Below is the screenshot of the full error:

enter image description here

I am using sucker_punch version 2.0.1 right now. I have tried to downgrade it and using sucker_punch version 1.6.0 instead, but the error persist.

Any help? Thanks!

like image 614
Ryzal Yusoff Avatar asked Oct 22 '25 06:10

Ryzal Yusoff


1 Answers

Okay I have finally figured it out. In my sucker_punch.rb file, I need to include this:

# config/initializers/sucker_punch.rb

require 'sucker_punch/async_syntax'

This is required for those who are using Sucker Punch version 2.0.0+ with Rails < 5.0.0 as explained here

like image 91
Ryzal Yusoff Avatar answered Oct 23 '25 21:10

Ryzal Yusoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!