undefined method `async' (suckerpunch gem) - ruby-on-rails

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:
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!

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

They've actually changed async syntax.
With newer versions of sucker_punch, you should call async like so:
Model.perform_async
It's mentioned under the Backwards Compatibility heading here
https://github.com/brandonhilkert/sucker_punch

Related

undefined method `boolean_label_class=' for SimpleForm

Attempting to run migration for my Rails app pixel_paisan is getting an error reading; NoMethodError: undefined method `boolean_label_class=' for SimpleForm:Module. Gist for the trace at https://gist.github.com/nbarnes/9796454dc28be9792284. Source code for error-production app at https://github.com/nbarnes/pixel_paisan.
I've tried uninstalling and reinstalling simple_form, doesn't help. Update entire gemset, doesn't help. Different ruby versions via RVM, doesn't help. Plain vanilla Rails app, created in an attempt to reproduce the bug works fine. Google doesn't know about my issue.
Does anybody know anything about this? I'm rapidly running out of angles to attack it from.
Short answer: update your simple_form gem to 3.1.0+. You have simple_form (3.0.2)
Longer answer: See https://github.com/rafaelfranca/simple_form-bootstrap/issues/44 which seems to be someone who had the same issue where the answer is to upgrade to simple_form 3.1.0+ whereas your Gemfile has simple_form (3.0.2)

aws-s3 gem unless defined? ##{:instance_writer=>true}

I am trying to integrate the aws-s3 gem with the latest version of Rails (4.1.0), and when starting the server I receive this error:
aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': ///.rvm/gems/ruby-1.9.3-p385/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: syntax error, unexpected $undefined (SyntaxError) unless defined? ##{:instance_writer=>true}
Has anyone got any ideas?
The bulk of the gem has not been updated for over two years so I am thinking that it may finally be out of date.
In Rails 4.1 the bug is happening because cattr_attribute was removed from Module.
A short look at the issues in github: they say that the project has been abandoned.
This pull request was to fix the issue:
https://github.com/marcel/aws-s3/pull/95
You may want to use one of forks like https://github.com/bartoszkopinski/aws-s3, that fixes the issue, or change the gem to the https://github.com/aws/aws-sdk-ruby.

Rails 3.2: Undefined method 'class_inheritable_accessor' in activemerchant

I'm building my first Rails app and trying to integrate active_paypal_adaptive_payment with Rails 3.2.1, however when I try to boot up the rails server it runs into the problem of, "undefined method 'class_inheritable_accessor' (in line 4 of post_date.rb) in the activemerchant-1.5.1 gem of which is a dependency.
I've looked around and seems this method has been removed in rails 3.2. From what I understand, it's not as simple as going into the activemerchant gem and replacing class_inheritable_accessor with class_attribute (read this conversation).
Any ideas on how I could update this gem so it could be compatible with Rails 3.2? It's an outstanding issue on the github page so appreciate any help with it!
This particular commit solved my issue: https://github.com/cmezak/active_paypal_adaptive_payment/commit/c6661704c45b73a0be5c608c673b106ac1eb5b69

Rails 2.3.8 tiny mce issue - undefined method `uses_tiny_mce'

I am facing an issue in my application with tiny mce.
All the gem version & ruby version is OK on my system, but it is giving me error
= undefined method `uses_tiny_mce'
Here i installed the tiny_mce gem. COnfigured it correctely, but still there is an issue.
Please help.
Did you include
config.gem 'tiny_mce'
in config/environment.rb?
I have used this gem in the past too, but have stopped using it. I figured it complicated the setup and deployment of my Rails apps. Since then I have just used the TinyMCE editor by itself. Since it is 100% javascript, it does not touch any Ruby code which keeps things better organized.
I was not using this as a plugin.
I have followed the steps given in the,
http://enginey.googlecode.com/svn/trunk/vendor/plugins/tiny_mce/README.rdoc
Steps :
script/plugin install git://github.com/kete/tiny_mce.git
rake tiny_mce:install
my issue got resolved.

Rails 2.3.9, adding ActiveScaffold, getting in `alias_method': undefined method `number_of_pages' for class `Paginator'

I have AS (as a plugin) working in another app just fine (I dont remember this
issue...) - its also using Rails 2.3.9, on same dev box.
Now trying to add it to a new app and getting this error when running
the webrick, script/server:
/Users/kimptoc/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.9/lib/
active_support/core_ext/module/aliasing.rb:33:in `alias_method':
undefined method `number_of_pages' for class `Paginator' (NameError)
from /Users/kimptoc/.rvm/gems/ruby-1.8.7-p302/gems/
activesupport-2.3.9/lib/active_support/core_ext/module/aliasing.rb:
33:in `alias_method_chain'
from /Users/kimptoc/Documents/ruby/borisbikestats/vendor/plugins/
active_scaffold/lib/extensions/paginator_extensions.rb:9
I couldn't find any previous references to this error.
Embarassingly I dont know which version of AS I am using successfully... it says 1.2RC1 in the CHANGELOG file, but I seem to remember trying a few of the forks...(is there somewhere I can see which fork is in use...). I have tried using the the 'main' activescaffold in the new project, but it fails as above, but so does using the same plugin that is in the working project :(
Thanks in advance for any pointers as to what I am doing wrong.
Thanks,
Chris
PS Just realised that new Rails was using Rails 3 and old/working one was 2.3.9. It seems you need to use an alternate branch of AS for Rails 3, like this : https://github.com/vhochstein/active_scaffold/wiki
This is just a guess, but built in pagination was removed in Rails 2 as I recall, and you needed to install the classic_pagination plugin to get that functionality back.
I only used ActiveScaffold once, but the error there says paginator_extensions.rb ... it's probably monkey patching the old Rails paginator? Therefore the class exists but the number_of_pages method doesn't.

Resources