Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Getting error when run command "rails console"...

Ruby on Rails

  • Please log in to reply
1 reply to this topic

#1 suvii

suvii

    Passenger

  • Members
  • 1 posts

Posted 19 August 2014 - 11:23 AM

Hii everyone,

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


How can i resolve it??? Plzzzzzzz help



#2 ajaysahu

ajaysahu

    Dispatcher

  • Members
  • 30 posts

Posted 29 September 2014 - 12:07 PM

In Rails 4 we don't have attr_accessible.

check in your  vote.rb file and replace those attr_accessible  with attr_accessor. 

 

check this : 

http://rubyinrails.c...essor-in-rails/







Also tagged with one or more of these keywords: Ruby on Rails

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users