Hi,
I am new to ruby on rails development. Please excuse me if my question
is too obvious. I am trying to upgrade from rails 3.0 to 3.2. I am stuck
at a point. I am running into this following error.
INTERNAL ERROR!!! undefined method abstract_class?' for #<Class:0x007f8692ac2450> /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/attr_encrypted-1.2.1/lib/attr_encrypted.rb:241:in
method_missing’
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in
method_missing' /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/attr_encrypted-1.2.1/lib/attr_encrypted/adapters/active_record.rb:50:in
method_missing_with_attr_encrypted’
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/base.rb:421:in
`inspect’
What I found is that, the method ‘abstract_class?’ has been moved from
base.rb to inheritance.rb in rails 3.2.
I was actually trying to use execute the following statement when this
error happened.
ActiveRecord::Base.connection.column_exists? klass.table_name, :user_id
Any ideas on work arounds
Thanks in advance.
Chaitanya
On Wednesday, 19 August 2015 20:20:59 UTC-5, Ruby-Forum.com User wrote:
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/base.rb:421:in
That version of attr_encrypted is fairly old, but I don’t think it’s the
culprit. Can you post the full stack trace?
–Matt J.
Thanks Matt. Here’s is the longer stack trace. I got past this error
when I copied
the abstract_class? and other methods from inheritance.rb to base.rb.
How can we make ActiveRecord bse.rb include inheritance.rb so we dont
have to so that?
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/attr_encrypted-1.2.1/lib/attr_encrypted.rb:241:in
method_missing': undefined method
abstract_class?’ for
#Class:0x007f9c0b678410 (NoMethodError)
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in
method_missing' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/attr_encrypted-1.2.1/lib/attr_encrypted/adapters/active_record.rb:50:in
method_missing_with_attr_encrypted’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:142:in
reset_table_name' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:104:in
table_name’
from
/Users/CRalladoddi/ABC/deviceservice/app/models/concerns/acts_as_asset.rb:7:in
included' from /Users/CRalladoddi/ABC/deviceservice/app/models/notification.rb:26:in
include’
from
/Users/CRalladoddi/ABC/deviceservice/app/models/notification.rb:26:in
<class:Notification>' from /Users/CRalladoddi/ABC/deviceservice/app/models/notification.rb:20:in
<top (required)>’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
block in require’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in
require_or_load' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in
load_missing_constant’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in
block in const_missing' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in
each’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in
const_missing' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:514:in
load_missing_constant’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in
block in const_missing' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in
each’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in
const_missing' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in
block in constantize’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in
each' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in
constantize’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:260:in
safe_constantize' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/core_ext/string/inflections.rb:66:in
safe_constantize’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:152:in
_default_wrap_model' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:169:in
_set_wrapper_defaults’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:133:in
inherited' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.13/lib/abstract_controller/railties/routes_helpers.rb:7:in
block (2 levels) in with’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.13/lib/action_controller/railties/paths.rb:7:in
block (2 levels) in with' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/bundler/gems/aylauth-1e9668412cc5/app/controllers/aylauth/notifications_controller.rb:2:in
module:Aylauth’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/bundler/gems/aylauth-1e9668412cc5/app/controllers/aylauth/notifications_controller.rb:1:in
<top (required)>' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
block in require' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in
require_or_load’
from
/Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:313:in
depend_on' from /Users/CRalladoddi/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in
require_dependency’