Rails 3.2: Undefined method 'class_inheritable_accessor' in activemerchant - ruby-on-rails

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

Related

Can't create a new Spree app: "undefined method `raise_in_transactional_callbacks='"

I had this issue a couple of months ago, posted it on Spree's GitHub page, then figured out the solution myself and posted it on that same issue. Two months later, I'm still getting comments on that same issue from Googlers who had the same error message, so I figure it's worth posting my solution on this website as well just in case anyone is having the same problem but isn't looking on GitHub.
The issue: trying to create a brand new Spree app, following the exact instructions in Spree's documentation, gives the following error when you try to run spree install --auto-accept or rails g spree:install:
undefined method `raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)
Solution below...
The problem: I'd created a new rails app with rails new, which had automatically created an app using rails 4.2.0beta. Then I had issues with gem incompatibilities, so I'd changed the version number of a few gems, including downgrading Rails back to 4.1.8.
BUT the config setting raise_in_transactional_callbacks is new in Rails 4.2.0, so in earlier versions of Rails it will raise an error. If you're getting this error message you need to remove the line config.active_record.raise_in_transactional_callbacks = true from config/application.rb.

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)

Raipidfire Survey Gem

I'm trying to build a survey application with the rapidfire gem. I can create a question group but when I try to answer a question i get the error undefined method primary_key?
Does anyone know why I'm getting this? I'm using ruby 1.9.3 and Ruby on rails 3.2.16

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.

Replacing the 'auto_link' method in Ruby on Rails 3.1

I am using Ruby on Rails 3.0.7 and I know that in the 3.1 version there won't be the auto_link method anymore (see the actionpack/lib/action_view/helpers/text_helper.rb for RoR 3.1).
Is there another way to have similar functions as the old auto_link method? That is, how can I replace that useful method in Ruby on Rails 3.1?
BTW: why will the auto_link method will be removed?
Rinku is a drop-in replacement for Rails 3.1 auto_link.
Auto-linking functionality has been removed from Rails 3.1, and is instead offered as a standalone gem, rails_autolink. You can choose to use Rinku instead.
require 'rails_rinku'
The rails_rinku package monkeypatches Rails with an auto_link method that mimics 100% the original one, parameter per parameter. It's just faster.
Not sure why, but Aaron Patterson (Rails Core team) seem to have the gem for this as well https://github.com/tenderlove/rails_autolink (which worked fine for me, YMMV)

Resources