awesome_nested_set error when running rake during upgrade to 5.0 from 4.2.3

Added by Halle Winkler 6 months ago

Greetings,

I am currently running Redmine 4.2.3 on MacOS 12.1 with no issues, and went to upgrade to 5.0 today. I am using RVM with Ruby 2.7.3 and I have set it for use with Redmine (confirmed by running `rvm list` in the directory). I pulled the 5.0.0 git repo, did bundle update, and then ran `bundle exec rake db:migrate RAILS_ENV=production` and received this error at the top of the stack trace:

`LoadError: cannot load such file -- awesome_nested_set/awesome_nested_set`

I read the FAQ and install issues wiki and I couldn't find the issue in there. When I attempted to follow the instruction to run `RAILS_ENV=production script/about` I received a "not found" error, but when I instead ran `RAILS_ENV=production bin/about` I received the same stack trace about awesome_nested_set.

To troubleshoot I directly ran `gem install awesome_nested_set` but it still can't be loaded for the migration. Very grateful for any assistance here, thank you.

Replies (4)

RE: awesome_nested_set error when running rake during upgrade to 5.0 from 4.2.3 - Added by Halle Winkler 6 months ago

the output of `bundle exec rake db:migrate RAILS_ENV=production --trace`

** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
LoadError: cannot load such file -- awesome_nested_set/awesome_nested_set
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
/Users/username/Documents/redmine/lib/plugins/awesome_nested_set/lib/awesome_nested_set.rb:1:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
/Users/username/Documents/redmine/lib/plugins/awesome_nested_set/init.rb:1:in `block in <top (required)>'
/Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:10:in `eval'
/Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:10:in `block in <top (required)>'
/Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:4:in `each'
/Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:4:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `load'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `block in load'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `load'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:681:in `block in load_config_initializer'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/notifications.rb:205:in `instrument'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:680:in `load_config_initializer'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:633:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:633:in `block in <class:Engine>'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `instance_exec'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `run'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:50:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:50:in `tsort_each_child'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `call'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `call'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
/Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:60:in `run_initializers'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/application.rb:391:in `initialize!'
/Users/username/Documents/redmine/config/environment.rb:16:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/application.rb:367:in `require_environment!'
/Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/Users/username/.rvm/gems/ruby-2.7.3/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.7.3/bin/rake:23:in `load'
/Users/username/.rvm/gems/ruby-2.7.3/bin/rake:23:in `<main>'
/Users/username/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `eval'
/Users/username/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment

RE: awesome_nested_set error when running rake during upgrade to 5.0 from 4.2.3 - Added by Halle Winkler 6 months ago

The output of ` RAILS_ENV=production bin/about --trace`:

Traceback (most recent call last):
    49: from bin/about:4:in `<main>'
    48: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    47: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    46: from /Users/username/Documents/redmine/config/environment.rb:16:in `<top (required)>'
    45: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/application.rb:391:in `initialize!'
    44: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:60:in `run_initializers'
    43: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
    42: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
    41: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
    40: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `call'
    39: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each'
    38: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
    37: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
    36: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `call'
    35: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:50:in `tsort_each_child'
    34: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:50:in `each'
    33: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
    32: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
    31: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
    30: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    29: from /Users/username/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
    28: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:61:in `block in run_initializers'
    27: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `run'
    26: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `instance_exec'
    25: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:633:in `block in <class:Engine>'
    24: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:633:in `each'
    23: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>'
    22: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:680:in `load_config_initializer'
    21: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/notifications.rb:205:in `instrument'
    20: from /Users/username/.rvm/gems/ruby-2.7.3/gems/railties-6.1.4.7/lib/rails/engine.rb:681:in `block in load_config_initializer'
    19: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `load'
    18: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
    17: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `block in load'
    16: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:326:in `load'
    15: from /Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:4:in `<top (required)>'
    14: from /Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:4:in `each'
    13: from /Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:10:in `block in <top (required)>'
    12: from /Users/username/Documents/redmine/config/initializers/00-core_plugins.rb:10:in `eval'
    11: from /Users/username/Documents/redmine/lib/plugins/awesome_nested_set/init.rb:1:in `block in <top (required)>'
    10: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
     9: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
     8: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
     7: from /Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
     6: from /Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
     5: from /Users/username/Documents/redmine/lib/plugins/awesome_nested_set/lib/awesome_nested_set.rb:1:in `<top (required)>'
     4: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
     3: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
     2: from /Users/username/.rvm/gems/ruby-2.7.3/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
     1: from /Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/Users/username/.rvm/gems/ruby-2.7.3/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- awesome_nested_set/awesome_nested_set (LoadError)

RE: awesome_nested_set error when running rake during upgrade to 5.0 from 4.2.3 - Added by Halle Winkler 6 months ago

I was able to fix this by adding the line `gem 'awesome_nested_set'` to Redmine's Gemfile and running `bundle install` and `bundle update` and then proceeding with the installation. It was not helped by installing the gem directly using `gem install awesome_nested_set`, just by adding it to the Gemfile and letting bundle install it. Still wondering why this was necessary, though.

RE: awesome_nested_set error when running rake during upgrade to 5.0 from 4.2.3 - Added by Holger Just 6 months ago

Your stack traces mention code being loaded at (or below) the path /Users/username/Documents/redmine/lib/plugins/awesome_nested_set. There should be no such core plugin there in Redmine 5.0 (or any version newer than 3.0).

All the code within lib/plugins is intended to be part of Redmine itself and should not be manually changed. Also, all of the code there must be taken entirely from your current Redmine release. The directory must not be copied from previous Redmine versions on upgrade. If you have cusotm plugin, please put them into the plugins directory directly within your Redmine directory.

With the release of Redmine 3.0, Redmine stopped using awesome_nested_set in favor of its own simpler implementation. Neither the awesome_nested_set gem (nor the previously vendored plugin) is thus required for quite some time anymore.

As such, please make sure that the entire contents of the lib/plugins directory is unchanged from the code in the Redmine 5.0.0 release with no additions or changes. You should also revert any changes to the Gemfile and other code belonging to Redmine itself.

(1-4/4)