mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.96k stars 1.19k forks source link

getting some NameError exceptions when my Rails app is first started up #1073

Open MSeneadza opened 2 years ago

MSeneadza commented 2 years ago

Two days ago I updated my app. I went from:

acts_as_taggable (master branch, which I was running since December 22nd in order to get Rails 7 support) Ruby 3.0.1 Rails 7.0.0

to

acts_as_taggable 9.0.1 Ruby 3.1.0 Rails 7.0.1

Once I did that I started seeing errors like this in my exception tracker:

NameError: constant ActsAsTaggableOn::Core not defined NameError: constant ActsAsTaggableOn::Cache not defined NameError: constant ActsAsTaggableOn::Ownership not defined

They were very infrequent and I could not reproduce them when clicked the URLs that initially triggered them. Today I manually restarted my Heroku web dyno and immediately saw a couple of these exceptions come through. So it seems that something isn't getting loaded properly / fully/ quickly enough when the app starts up.

Here's one of the stack traces:

1 File "/app/vendor/bundle/ruby/3.1.0/gems/acts-as-taggable-on-9.0.1/lib/acts_as_taggable_on/taggable.rb" line 115 in taggable_on 2 File "/app/vendor/bundle/ruby/3.1.0/gems/acts-as-taggable-on-9.0.1/lib/acts_as_taggable_on/taggable.rb" line 41 in acts_as_taggable_on 3 File "/app/vendor/bundle/ruby/3.1.0/gems/acts-as-taggable-on-9.0.1/lib/acts_as_taggable_on/taggable.rb" line 17 in acts_as_taggable 4 File "/app/app/models/equity.rb" line 114 in

And like 114 in equity.rb just has acts_as_taggable

I'm not sure if Rails or Ruby changed something to cause this but I'm not seeing any similar errors from any other gems I'm using. So I just thought I'd post to see if anyone else is having this issue.

Cashaca commented 6 months ago

I also have these problems sporadically. Not every time when starting a web dyno on Heroku so probably it depends on the random order in which classes / modules are loaded

constant ActsAsTaggableOn::Core not defined and also undefined method `all_tags_list_on'

xpostudio4 commented 2 months ago

Does anyone has any idea of the source of this problem?