undefined method `boolean_label_class=' for SimpleForm - ruby-on-rails

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)

Related

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

Haml not working with Rails

So, I know there are multiple questions and solutions on StackOverflow about Haml not working on Rails, but those haven't helped me, that's why I try again (and try to document as precise as I can).
Today, I install Haml by doing gem install haml. This installed Haml, and I tried changing my index.html.erb to index.html.haml. I got the following error:
I googled and found some solutions on StackOverflow, mentioning I should restart my server (tried it, didn't solve it) and the second solution was: install haml-rails instead of just haml and then restart my server. That didn't work, so I uninstalled haml and haml-rails, after which I installed haml-rails again (I thought the might've been bugging eachother), but to no avail.
I then read somewhere that people didn't even have Haml in their gems-list when executing bundle show (yes, I also put the gem in my bundle list). So I tried that, and indeed, Haml doesn't show up in my list of installed gems.
So, I'm hoping someone can help me out, because I'm at a loss here. If you have any questions of if I should clarify something in more detail, please ask!
Apparently, the problem was that I ran gem install haml-rails and didn't add it in my Gemfile. That's what solved the problem. I had no idea not adding it to the Gemfile and just installing it manually, could bring up errors. (Coincidentally, Marek Lipka wrote a comment with the "solution" at the moment of writing this answer).

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

Pagination doesn't work with will_paginate. Could anyone help with this?

I am currently using Rails 2.3.5. I installed will_paginate gem 2.3.16 as suggested in the will_paginate github page. But will_paginate is not being recognized when I use it and I always end up with an error. I have attached the screenshot of the error when used from the project console and have also included my gem list.
What am I doing wrong? Should i include any more configuration? or is there a better way of doing pagination?
Last time I looked at this issue (3 months ago?) it looked as if will-paginate was not being actively maintained, and wasn't compatible with rails 3. So I changed to Kaminari, which I've found causes me less problems. There's a railscast on kaminari here too

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.

Resources