Skip to content

Gem Load Error is: uninitialized constant ActsAsTree::InstanceMethods::ActiveRecord #84

@jensb

Description

@jensb

I am getting this error when using gem 'acts_as_tree' in my Rails project's Gemfile. (Rails 5.2.4, Ruby 2.5.0, on Ubuntu Linux), also when adding a , git: line to point to this repository.
Why is the gem assuming "ActiveRecord" is a local constant inside the module? Even ::ActiveRecord does not seem to help.
acts_as_tree worked fine when I was using Rails 4.2 and Ruby 1.9.3 before starting the upgrade.

$ bundle exec rails c
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'acts_as_tree'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant ActsAsTree::InstanceMethods::ActiveRecord
Did you mean?  ActiveModel
Backtrace for gem load error is:
/home/jens/.bundle/ruby/2.5.0/acts_as_tree-2e2890a7c082/lib/acts_as_tree.rb:355:in `<module:InstanceMethods>'
/home/jens/.bundle/ruby/2.5.0/acts_as_tree-2e2890a7c082/lib/acts_as_tree.rb:242:in `<module:ActsAsTree>'
/home/jens/.bundle/ruby/2.5.0/acts_as_tree-2e2890a7c082/lib/acts_as_tree.rb:3:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:81:in `require'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:81:in `block (2 levels) in require'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:76:in `each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:76:in `block in require'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:65:in `each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:65:in `require'
/usr/lib/ruby/vendor_ruby/bundler.rb:114:in `require'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions