You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've stumbled upon an issue while installing this gem. When starting up the rails application, console or the mentionend installer I get the following error:
undefined method 'thread_mattr_accessor' for GoodJob::CurrentExecution:Module (NoMethodError)
I checked what caused the error and it seems like the gem is currently not working when one excludes the sprockets railstie in application.rb. The sprockets railstie requires action_view/helpers which then somehow requires the active support core extension that holds the required method. My best bet would be to simply require the core extension active_support/core_ext/module/attribute_accessors_per_thread in lib/good_job/current_execution.rb where the missing method is used.
While this issue is not fixed one can just require the mentioned core extension in application.rb.
Steps to reproduce
rails new good_job --skip-sprockets (make sure sprockets/railstie is not required in config/application.rb)
Add gem 'good_job' to your Gemfile
bundle install
rails g good_job:install
Backtrace
Traceback (most recent call last):
49: from bin/rails:4:in `<main>'
48: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
47: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
46: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
45: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
44: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
43: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
42: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
41: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
40: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>'
39: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/command.rb:46:in `invoke'
38: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/command/base.rb:69:in `perform'
37: from /home/richard/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
36: from /home/richard/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
35: from /home/richard/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
34: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/commands/console/console_command.rb:101:in `perform'
33: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
32: from /home/richard/.rvm/gems/ruby-2.7.1/gems/railties-6.0.3.2/lib/rails/command/actions.rb:22:in `require_application!'
31: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
30: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
29: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
28: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
27: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
26: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
25: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
24: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
23: from /home/richard/repos/oer/backend/config/application.rb:17:in `<main>'
22: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler.rb:174:in `require'
21: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:58:in `require'
20: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:58:in `each'
19: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:69:in `block in require'
18: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:69:in `each'
17: from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:74:in `block (2 levels) in require'
16: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
15: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
14: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
13: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
12: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
11: from /home/richard/.rvm/gems/ruby-2.7.1/gems/good_job-1.2.0/lib/good_job.rb:13:in `<main>'
10: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
9: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
8: from /home/richard/.rvm/gems/ruby-2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
7: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
6: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
5: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
4: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
3: from /home/richard/.rvm/gems/ruby-2.7.1/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
2: from /home/richard/.rvm/gems/ruby-2.7.1/gems/good_job-1.2.0/lib/good_job/current_execution.rb:1:in `<main>'
1: from /home/richard/.rvm/gems/ruby-2.7.1/gems/good_job-1.2.0/lib/good_job/current_execution.rb:5:in `<module:GoodJob>'
/home/richard/.rvm/gems/ruby-2.7.1/gems/good_job-1.2.0/lib/good_job/current_execution.rb:10:in `<module:CurrentExecution>': undefined method `thread_mattr_accessor' for GoodJob::CurrentExecution:Module (NoMethodError)
System info
Ruby 2.7.1
Rails 6.0.3.2
The text was updated successfully, but these errors were encountered:
Hey there!
I've stumbled upon an issue while installing this gem. When starting up the rails application, console or the mentionend installer I get the following error:
undefined method 'thread_mattr_accessor' for GoodJob::CurrentExecution:Module (NoMethodError)
I checked what caused the error and it seems like the gem is currently not working when one excludes the sprockets railstie in
application.rb
. The sprockets railstie requires action_view/helpers which then somehow requires the active support core extension that holds the required method. My best bet would be to simply require the core extensionactive_support/core_ext/module/attribute_accessors_per_thread
inlib/good_job/current_execution.rb
where the missing method is used.While this issue is not fixed one can just require the mentioned core extension in application.rb.
Steps to reproduce
rails new good_job --skip-sprockets
(make suresprockets/railstie
is not required inconfig/application.rb
)gem 'good_job'
to your Gemfilebundle install
rails g good_job:install
Backtrace
System info
Ruby 2.7.1
Rails 6.0.3.2
The text was updated successfully, but these errors were encountered: