Skip to content

Initializer generates uninitialized constant error when not all decidim modules are enabled #9423

@alecslupu

Description

@alecslupu

Describe the bug
I am trying to install a decidim custom version of the application, without having all the decidim modules ( i am not interested in having Budgets, Accountability etc)

I have added to my gemfile


DECIDIM_VERSION = { git: "https://github.com/decidim/decidim", branch: "develop" }

# This is extracted from main decidim.gemspec
# gem "decidim-accountability", DECIDIM_VERSION
gem "decidim-admin", DECIDIM_VERSION
gem "decidim-api", DECIDIM_VERSION
gem "decidim-assemblies", DECIDIM_VERSION
gem "decidim-blogs", DECIDIM_VERSION
# gem "decidim-budgets", DECIDIM_VERSION
gem "decidim-comments", DECIDIM_VERSION
gem "decidim-core", DECIDIM_VERSION
# gem "decidim-debates", DECIDIM_VERSION
gem "decidim-forms", DECIDIM_VERSION
# gem "decidim-generators", DECIDIM_VERSION
gem "decidim-meetings", DECIDIM_VERSION
gem "decidim-pages", DECIDIM_VERSION
gem "decidim-participatory_processes", DECIDIM_VERSION
gem "decidim-proposals", DECIDIM_VERSION
# gem "decidim-sortitions", DECIDIM_VERSION
gem "decidim-surveys", DECIDIM_VERSION
gem "decidim-system", DECIDIM_VERSION
# gem "decidim-templates", DECIDIM_VERSION
gem "decidim-verifications", DECIDIM_VERSION

# gem "decidim-conferences", DECIDIM_VERSION
# gem "decidim-consultations", DECIDIM_VERSION
# gem "decidim-elections", DECIDIM_VERSION
# gem "decidim-initiatives", DECIDIM_VERSION
# EOF This is extracted from main decidim.gemspec

When attempting to boot the application, using the above Gemfile configuration, i get an error like: uninitialized constant Decidim::Budgets (NameError)

To Reproduce
Steps to reproduce the behavior:

  1. Generate a new application
  2. Replace the decidim installation as above
  3. Run bundle install
  4. Run rails console
  5. See error

Expected behavior
The application should boot normally.

Stacktrace

\/code/config/initializers/decidim.rb:418:in `<main>': uninitialized constant Decidim::Budgets (NameError)
	from /bundle_cache/ruby/3.0.0/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
	from /bundle_cache/ruby/3.0.0/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/engine.rb:681:in `block in load_config_initializer'
	from /bundle_cache/ruby/3.0.0/gems/activesupport-6.1.6/lib/active_support/notifications.rb:205:in `instrument'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/engine.rb:680:in `load_config_initializer'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/engine.rb:633:in `each'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/engine.rb:633:in `block in <class:Engine>'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `instance_exec'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `run'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/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_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:50:in `each'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/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_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:60:in `run_initializers'
	from /bundle_cache/ruby/3.0.0/gems/railties-6.1.6/lib/rails/application.rb:391:in `initialize!'
	from /code/config/environment.rb:5:in `<main>'
	from /bundle_cache/ruby/3.0.0/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /bundle_cache/ruby/3.0.0/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /bundle_cache/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
	from /bundle_cache/ruby/3.0.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from -e:1:in `<main>'

Extra data (please complete the following information):

  • Device: Desktop
  • Device OS: Ubuntu
  • Browser: Firefox
  • Decidim Version: 0.27-dev
  • Decidim installation: European Research Innovation Days

Additional context
N/A

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions