spree-contrib / spree_multi_vendor

Spree marketplace extension. Create your own marketplace on top of Spree Commerce
https://spreecommerce.org/marketplace-ecommerce/
BSD 3-Clause "New" or "Revised" License
142 stars 135 forks source link

uninitialized constant SpreeMultiVendor::Configuration #215

Closed matmorel closed 1 year ago

matmorel commented 1 year ago

I'm trying to install the extension on a fresh spree-starter installation, when running bundle exec rails g spree_multi_vendor:install I get this error:

$ docker-compose run web bundle exec rails g spree_multi_vendor:install

/bundle/ruby/3.0.0/gems/spree_multi_vendor-2.3.0/lib/spree_multi_vendor/engine.rb:13:in `block in <class:Engine>': uninitialized constant SpreeMultiVendor::Configuration (NameError)
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:50:in `each'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:50:in `tsort_each_child'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:415:in `call'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:415:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
        from /app/config/environment.rb:5:in `<main>'
        from /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /bundle/ruby/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
        from /bundle/ruby/3.0.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/application.rb:348:in `require_environment!'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command/actions.rb:28:in `require_environment!'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands/generate/generate_command.rb:21:in `perform'
        from /bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
        from /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
        from /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from bin/rails:4:in `<main>'

Steps to reproduce:

git clone https://github.com/spree/spree_starter.git
cd spree_starter
bin/start-docker
docker-compose stop
echo "gem 'spree_multi_vendor'" >> Gemfile
docker-compose run web bundle install
docker-compose run web bundle exec rails g spree_multi_vendor:install
channainfo commented 1 year ago

I've got the same problem after trying to upgrade to Rails 7.0.4 and spree 4.5

samxtu commented 1 year ago

Same here, it happens with most of the spree extensions.

matmorel commented 1 year ago

The issue is fixed by the 2.4.0 release:

git clone https://github.com/spree/spree_starter.git
cd spree_starter
bin/setup
echo "gem 'spree_multi_vendor', git: 'https://github.com/spree-contrib/spree_multi_vendor.git', branch: 'main'" >> Gemfile
docker-compose run web bundle install
docker-compose run web bundle exec rails g spree_multi_vendor:install