I m newbie to RoR. Today morning i have just updated my gems file using command update gems. My earlier rails version was 4.1.4 and now updated rails version is 4.1.5. When i m trying to open console gives me error. Below is error list:-
/home/xyz/.gem/ruby/gems/activerecord-4.1.4/lib/active_record/dynamic_matchers.rb:26:in method_missing': undefined method attr_accessible’ for #<Class:0x00000002983670> (NoMethodError)
from /home/suvarna/.gem/ruby/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:8:in <class:Vote>' from /home/suvarna/.gem/ruby/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:4:in <module:ActsAsVotable>’
from /home/suvarna/.gem/ruby/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:3:in <top (required)>' from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require’
from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in block in require' from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in load_dependency’
from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require' from /home/suvarna/.gem/ruby/gems/acts_as_votable-0.5.0/lib/acts_as_votable.rb:11:in <module:ActsAsVotable>’
from /home/suvarna/.gem/ruby/gems/acts_as_votable-0.5.0/lib/acts_as_votable.rb:6:in <top (required)>' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in require’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in block (2 levels) in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in each’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in block in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in each’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler.rb:132:in require’
from /home/suvarna/Downloads/forbestechnosys-kms-5d6b520558db/config/application.rb:7:in <top (required)>' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:146:in require’
from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:146:in require_application_and_environment!' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:68:in console’
from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands.rb:17:in <top (required)>’
from script/rails:6:in require' from script/rails:6:in <main>’
The attr_accessible method has been removed from Rails 4.1+
You’re using version 0.5 of of the ‘acts_as_votable’ gem which relies on this method, if you update the version to the latest in Gemfile and run ‘bundle install’ it should work as expected.
gem ‘acts_as_votable’, ‘~> 0.10.0’
If you’re using attr_accessible in other parts of your application you’ll need to learn about Strong Parameters
Your answer was so much helpful for me. It have solved method missing error for me. I have changed the version of “acts_as_votable” 0.5 to 0.10 and bundle install. but now i m getting new error:-
home/suvarna/.gem/ruby/gems/strong_parameters-0.1.4/lib/action_controller/parameters.rb:6:in <module:ActionController>': superclass mismatch for class ParameterMissing (TypeError) from /home/suvarna/.gem/ruby/gems/strong_parameters-0.1.4/lib/action_controller/parameters.rb:5:in <top (required)>’
from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require' from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in block in require’
from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in load_dependency' from /home/suvarna/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require’
from /home/suvarna/.gem/ruby/gems/strong_parameters-0.1.4/lib/strong_parameters.rb:1:in <top (required)>' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in require’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:76:in block (2 levels) in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in each’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:72:in block in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in each’
from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler/runtime.rb:61:in require' from /home/suvarna/.gem/ruby/gems/bundler-1.6.5/lib/bundler.rb:132:in require’
from /home/suvarna/Downloads/forbestechnosys-kms-5d6b520558db/config/application.rb:7:in <top (required)>' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:146:in require’
from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:146:in require_application_and_environment!' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:68:in console’
from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /home/suvarna/.gem/ruby/gems/railties-4.1.4/lib/rails/commands.rb:17:in <top (required)>’
from script/rails:6:in require' from script/rails:6:in <main>’
I was able to install those gems ok with bundler but try removing gem ‘strong_parameters’ like I was saying in the previous post and see if that helps.