Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install: uninitialized constant Spree::User (NameError) #4038

Closed
my-very-own-account opened this issue Apr 25, 2021 · 3 comments
Closed

Comments

@my-very-own-account
Copy link

my-very-own-account commented Apr 25, 2021

  1. Ran rails new test --skip-spring (6.1.3.1)
  2. Added gem 'solidus', '3.0.0' to Gemfile and ran bundle
  3. Ran rails g solidus:install but got:
Traceback (most recent call last):
  67: from bin/rails:4:in `<main>'
  66: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
  65: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
  64: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
  63: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
  62: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
  61: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/commands.rb:18:in `<main>'
  60: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/command.rb:50:in `invoke'
  59: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/command/base.rb:69:in `perform'
  58: from /home/dev/.gem/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
  57: from /home/dev/.gem/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
  56: from /home/dev/.gem/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
  55: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/commands/generate/generate_command.rb:21:in `perform'
  54: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
  53: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/command/actions.rb:28:in `require_environment!'
  52: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/application.rb:360:in `require_environment!'
  51: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:332:in `require'
  50: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:299:in `load_dependency'
  49: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:332:in `block in require'
  48: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
  47: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
  46: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
  45: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
  44: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
  43: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
  42: from /home/dev/multidomaintest/config/environment.rb:5:in `<main>'
  41: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/application.rb:384:in `initialize!'
  40: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/initializable.rb:60:in `run_initializers'
  39: from /usr/local/lib/ruby/2.7/tsort.rb:205:in `tsort_each'
  38: from /usr/local/lib/ruby/2.7/tsort.rb:226:in `tsort_each'
  37: from /usr/local/lib/ruby/2.7/tsort.rb:347:in `each_strongly_connected_component'
  36: from /usr/local/lib/ruby/2.7/tsort.rb:347:in `call'
  35: from /usr/local/lib/ruby/2.7/tsort.rb:347:in `each'
  34: from /usr/local/lib/ruby/2.7/tsort.rb:349:in `block in each_strongly_connected_component'
  33: from /usr/local/lib/ruby/2.7/tsort.rb:431:in `each_strongly_connected_component_from'
  32: from /usr/local/lib/ruby/2.7/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  31: from /usr/local/lib/ruby/2.7/tsort.rb:228:in `block in tsort_each'
  30: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
  29: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/initializable.rb:32:in `run'
  28: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/initializable.rb:32:in `instance_exec'
  27: from /home/dev/.gem/gems/railties-6.1.3.1/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
  26: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:508:in `eager_load_all'
  25: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:508:in `each'
  24: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:393:in `eager_load'
  23: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:393:in `synchronize'
  22: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:404:in `block in eager_load'
  21: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:725:in `ls'
  20: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:725:in `foreach'
  19: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:733:in `block in ls'
  18: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:409:in `block (2 levels) in eager_load'
  17: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:409:in `const_get'
  16: from /home/dev/.gem/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
  15: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
  14: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
  13: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
  12: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
  11: from /home/dev/.gem/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
  10: from /home/dev/.gem/gems/solidus_backend-3.0.0/app/controllers/spree/admin/store_credits_controller.rb:3:in `<main>'
   9: from /home/dev/.gem/gems/solidus_backend-3.0.0/app/controllers/spree/admin/store_credits_controller.rb:4:in `<module:Spree>'
   8: from /home/dev/.gem/gems/solidus_backend-3.0.0/app/controllers/spree/admin/store_credits_controller.rb:5:in `<module:Admin>'
   7: from /home/dev/.gem/gems/solidus_backend-3.0.0/app/controllers/spree/admin/store_credits_controller.rb:6:in `<class:StoreCreditsController>'
   6: from /home/dev/.gem/gems/solidus_backend-3.0.0/app/controllers/spree/admin/resource_controller.rb:131:in `belongs_to'
   5: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
   4: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `constantize'
   3: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `inject'
   2: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `each'
   1: from /home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:288:in `block in constantize'
/home/dev/.gem/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:288:in `const_get': uninitialized constant Spree::User (NameError)
% ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-openbsd]
@jarednorman
Copy link
Member

Hmm, yeah that's strange. I wonder if there's some gotcha with zeitwerk here. Does it work if you disable zeitwerk?

@my-very-own-account
Copy link
Author

That did indeed take care of it, thanks!

config/application.rb

load_defaults "6.1"
config.autoloader = :classic

@jarednorman
Copy link
Member

Ideally everything should be Zeitwerk compatible, so I've opened the issue above on solidusio/solidus_auth_devise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants