簡體   English   中英

Rails 服務器啟動后退出

[英]Rails server exiting after starting

我想開始使用rails,我正在使用git bash。 當我嘗試啟動 rails 服務器時,會發生此錯誤。 我已經嘗試過到處搜索,但我找不到解決這個問題的方法。 我為此下載了 ruby 3.0.0。 謝謝

=> 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 僅支持 Ruby 2.6 及更早版本。 您應該升級到 Rails 6,或將 Ruby 降級到 2.6。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM