简体   繁体   English

Rails 服务器启动后退出

[英]Rails server exiting after starting

I want to start using rails, I am using git bash.我想开始使用rails,我正在使用git bash。 As I try to start rails server, this error occurs.当我尝试启动 rails 服务器时,会发生此错误。 I already tried googling everywhere but I cant find the solution to this problem.我已经尝试过到处搜索,但我找不到解决这个问题的方法。 I downloaded ruby 3.0.0 for this.我为此下载了 ruby 3.0.0。 Thank you谢谢

=> Booting Puma
=> Rails 5.1.7 application starting in development
=> Run `rails server -h` for more startup options
Exiting
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/static.rb:109:in `initialize': wrong number of arguments (given 3, expected 2) (ArgumentError)
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:35:in `new'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:35:in `build'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:99:in `block in build'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:99:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:99:in `inject'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-5.1.7/lib/action_dispatch/middleware/stack.rb:99:in `build'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/engine.rb:508:in `block in app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/engine.rb:504:in `synchronize'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/engine.rb:504:in `app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/application/finisher.rb:45:in `block in <module:Finisher>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/initializable.rb:30:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/initializable.rb:59:in `block in run_initializers'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `call'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/initializable.rb:58:in `run_initializers'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/application.rb:353:in `initialize!'
        from c:/Sites/simple/config/environment.rb:5:in `<top (required)>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:24:in `app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:80:in `log_to_stdout'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:42:in `start'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:135:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Rails 5 only supports Ruby 2.6 and earlier. Rails 5 仅支持 Ruby 2.6 及更早版本。 You should upgrade to Rails 6, or downgrade Ruby to 2.6.您应该升级到 Rails 6,或将 Ruby 降级到 2.6。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM