ruby 3.0.4,redmine 5.0.0,rails 6.1.4,测试安装启动 webrick 失败,"wrong number of arguments"

ruby 3.0.4, redmine 5.0.0, rails 6.1.4, test install start with webrick fails, "wrong number of arguments"

新 ubuntu-20 系统具有以下内容:

  ruby 3.0.4
  rails 6.1.4
  redmine 5.0.0

安装后,尝试启动 webrick 测试服务器:

bundle exec rails server webrick -e redmine_test

失败:

/home/test_user/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor/base.rb:525:in `handle_argument_error':
  ERROR: "rails server" was called with arguments ["webrick"] (Thor::InvocationError)
Usage: "rails server -u [thin/puma/webrick] [options]"
        from .../thor-1.2.1/lib/thor/command.rb:34:in `rescue in run'
        from .../thor-1.2.1/lib/thor/command.rb:20:in `run'
        from .../thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from .../thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from .../railties-6.1.4.7/lib/rails/command/base.rb:69:in `perform'
        from .../railties-6.1.4.7/lib/rails/command.rb:48:in `invoke'
        from .../railties-6.1.4.7/lib/rails/commands.rb:18:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
.../railties-6.1.4.7/lib/rails/commands/server/server_command.rb:130:in `perform':
  wrong number of arguments (given 1, expected 0) (ArgumentError)
        from .../thor-1.2.1/lib/thor/command.rb:27:in `run'
        from .../thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from .../thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from .../railties-6.1.4.7/lib/rails/command/base.rb:69:in `perform'
        from .../railties-6.1.4.7/lib/rails/command.rb:48:in `invoke'
        from .../railties-6.1.4.7/lib/rails/commands.rb:18:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

我不清楚它在抱怨哪些参数/语法;我尝试了不同的组合,但都抱怨参数数量错误:

bundle exec rails server webrick -e redmine_test        (given 1, expected 0)
bundle exec rails server webrick -e=redmine_test        (given 1, expected 0)
RAILS_ENV=redmine_test bundle exec rails server webrick (given 1, expected 0)
bundle exec rails server webrick redmine_test           (given 2, expected 0)
bundle exec rails server webrick                        (given 1, expected 0)

command-line 格式似乎已更改 Rails 6:

> rails server --help
Usage:
  rails server -u [thin/puma/webrick] [options]
               ^^

您可能还需要将 webrick 添加到您的 Gemfile 中:

bundle add webrick