Upgrade from 4.1 to 4.1.1 error

Added by Marius Stoica 3 months ago

Hello!

I have Debian 10 with ruby 2.5.5, rails 5.2.4.1 served by Phusion Passenger 6.0.4 as module in Apache 2.4.38. I'm trying to upgrade Redmine from 4.1 to 4.1.1. When trying to generate the secret token I get this error message. What can be the problem?

$ bundle exec rake generate_secret_token
rake aborted!
TypeError: superclass mismatch for class Command
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:2:in `<class:Thor>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:1:in `require_relative'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/group.rb:1:in `require_relative'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/group.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/generators.rb:6:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/generators.rb:6:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/app_updater.rb:3:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/app_updater.rb:3:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks/framework.rake:41:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks/framework.rake:41:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks/framework.rake:40:in `block in <top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks/framework.rake:3:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks.rb:21:in `load'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks.rb:21:in `block in <top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks.rb:20:in `each'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/tasks.rb:20:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/application.rb:516:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/application.rb:516:in `run_tasks_blocks'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:459:in `load_tasks'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/railtie.rb:190:in `public_send'
/var/lib/gems/2.5.0/gems/railties-5.2.4.2/lib/rails/railtie.rb:190:in `method_missing'
/home/marius/redmine/Rakefile:7:in `<top (required)>'
/var/lib/gems/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/share/rubygems-integration/all/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Replies (5)

RE: Upgrade from 4.1 to 4.1.1 error - Added by Liane Hampe 2 months ago

Hi Marius,

A Superclass mismatch points to the problem that there is code (propably from different authors) that use the same class name and Ruby does not know which one to use. Therefore, I would guess you have some plugins installed. If so, you need to move them out of the realm of Redmine and try again.

If not, please let me know.

Best Regards,
Liane

RE: Upgrade from 4.1 to 4.1.1 error - Added by Marius Stoica 2 months ago

It worked! Thank you very much!

RE: Upgrade from 4.1 to 4.1.1 error - Added by Bence EORY about 16 hours ago

Hi!

I have very similar problem, but with Debian 10 and Redmine 3.3.1 -> Redmine 4.0.7 mysql DB migration!

bundle exec rake db:migrate RAILS_ENV=production --trace

rake aborted!
TypeError: superclass mismatch for class Command
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:2:in `<class:Thor>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:1:in `require_relative'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/group.rb:1:in `require_relative'
/var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/group.rb:1:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/generators.rb:6:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/generators.rb:6:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/app_updater.rb:3:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/app_updater.rb:3:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks/framework.rake:41:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks/framework.rake:41:in `block (2 levels) in <top (required)>'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/task_manager.rb:232:in `in_namespace'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/dsl_definition.rb:141:in `namespace'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks/framework.rake:40:in `block in <top (required)>'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/task_manager.rb:232:in `in_namespace'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/dsl_definition.rb:141:in `namespace'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks/framework.rake:3:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks.rb:21:in `load'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks.rb:21:in `block in <top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks.rb:20:in `each'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/tasks.rb:20:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/application.rb:516:in `require'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/application.rb:516:in `run_tasks_blocks'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/engine.rb:459:in `load_tasks'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/railtie.rb:190:in `public_send'
/var/lib/gems/2.5.0/gems/railties-5.2.4.4/lib/rails/railtie.rb:190:in `method_missing'
/usr/share/redmine/Rakefile:6:in `<top (required)>'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'

I'm not a Ruby expert, so I'm a little bit stuck with this situation.

gem -v

3.1.4

ruby -v

ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]

apache2 -v

Server version: Apache/2.4.38 (Debian)
Server built:   2020-08-25T20:08:29

There were plugins in the old 3.3.1 system, but they were removed!

Thanks for the help in advance!

RE: Upgrade from 4.1 to 4.1.1 error - Added by Bence EORY about 8 hours ago

I've fixed with the following modification my problem:

Added this line into /usr/share/redmine/Gemfile

gem "thor", "~> 0.20.3" 

Source: Bug #1885424 at Ubuntu's bug tracker for ruby-thor package

(1-5/5)