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

uninitialized constant Spree::Api::V1::BaseController (NameError) #223

Open
nmella opened this issue Oct 24, 2023 · 1 comment
Open

uninitialized constant Spree::Api::V1::BaseController (NameError) #223

nmella opened this issue Oct 24, 2023 · 1 comment

Comments

@nmella
Copy link

nmella commented Oct 24, 2023

ruby '3.2.0'
gem 'rails', '~> 7'
gem 'spree', '~> 4.6'
gem 'spree_backend', '~> 4.6'
gem 'spree_frontend'
gem 'spree_multi_vendor', :github => 'spree-contrib/spree_multi_vendor', :branch => 'main'

After executing:

bundle exec rails g spree_multi_vendor:install

Returned:

/bundle/ruby/3.2.0/bundler/gems/spree_multi_vendor-2a2dc0854589/app/controllers/spree/api/v1/vendors_controller.rb:4:in `<module:V1>': uninitialized constant Spree::Api::V1::BaseController (NameError)

      class VendorsController < Spree::Api::V1::BaseController
                                              ^^^^^^^^^^^^^^^^
Did you mean?  Spree::CmsPagesController
	from /bundle/ruby/3.2.0/bundler/gems/spree_multi_vendor-2a2dc0854589/app/controllers/spree/api/v1/vendors_controller.rb:3:in `<module:Api>'
	from /bundle/ruby/3.2.0/bundler/gems/spree_multi_vendor-2a2dc0854589/app/controllers/spree/api/v1/vendors_controller.rb:2:in `<module:Spree>'
	from /bundle/ruby/3.2.0/bundler/gems/spree_multi_vendor-2a2dc0854589/app/controllers/spree/api/v1/vendors_controller.rb:1:in `<main>'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:30:in `require'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/helpers.rb:135:in `cget'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/helpers.rb:25:in `each'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/helpers.rb:25:in `ls'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:16:in `each'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader.rb:377:in `each'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/loader.rb:377:in `eager_load_all'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
	from /app/config/environment.rb:5:in `<main>'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /bundle/ruby/3.2.0/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:38:in `require'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command/actions.rb:28:in `require_environment!'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/generate/generate_command.rb:21:in `perform'
	from /bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
	from /bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/app_loader.rb:59:in `block in exec_app'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/app_loader.rb:48:in `loop'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/app_loader.rb:48:in `exec_app'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/cli.rb:7:in `<top (required)>'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/exe/rails:10:in `require'
	from /bundle/ruby/3.2.0/gems/railties-7.0.8/exe/rails:10:in `<top (required)>'
	from /bundle/ruby/3.2.0/bin/rails:25:in `load'
	from /bundle/ruby/3.2.0/bin/rails:25:in `<top (required)>'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:491:in `exec'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
	from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/libexec/bundle:45:in `block in <top (required)>'
	from /usr/local/lib/ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/libexec/bundle:33:in `<top (required)>'
	from /usr/local/bundle/bin/bundle:25:in `load'
	from /usr/local/bundle/bin/bundle:25:in `<main>'
@poudelprakash
Copy link
Contributor

I am also facing same issue, did you get this resolved?

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