ruby-on-rails Rails::Engine是抽象的,不能直接示例化它

piv4azn7  于 2023-04-22  发布在  Ruby
关注(0)|答案(1)|浏览(117)
[WARNING] Could not load command "rails/commands/server/server_command". Error: Rails::Engine is abstract, you cannot instantiate it directly..
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/railtie.rb:246:in `initialize'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/railtie.rb:184:in `new'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/railtie.rb:184:in `instance'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/railtie.rb:223:in `method_missing'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.0/lib/active_support/descendants_tracker.rb:90:in `descendants'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.0/lib/active_support/callbacks.rb:923:in `block in define_callbacks'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.0/lib/active_support/callbacks.rb:920:in `each'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.0/lib/active_support/callbacks.rb:920:in `define_callbacks'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/engine.rb:427:in `<class:Engine>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/engine.rb:349:in `<module:Rails>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/engine.rb:11:in `<top (required)>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/application.rb:11:in `require'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/application.rb:11:in `<top (required)>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails.rb:13:in `require'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails.rb:13:in `<top (required)>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/commands/server/server_command.rb:5:in `require'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/commands/server/server_command.rb:5:in `<top (required)>'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:44:in `require'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:44:in `block (2 levels) in lookup'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:40:in `each'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:40:in `block in lookup'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:39:in `each'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command/behavior.rb:39:in `lookup'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command.rb:73:in `find_by_namespace'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/command.rb:46:in `invoke'
/home/sharique/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.0/lib/rails/commands.rb:18:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
rails aborted!
Rails::Engine is abstract, you cannot instantiate it directly.
/home/sharique/Desktop/CodeSlash/config/application.rb:5:in `require'
/home/sharique/Desktop/CodeSlash/config/application.rb:5:in `<top (required)>'
/home/sharique/Desktop/CodeSlash/Rakefile:5:in `require_relative'
/home/sharique/Desktop/CodeSlash/Rakefile:5:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
kpbpu008

kpbpu0081#

可能你需要更新Rails版本到7.0.1,因为有一个关于这个错误的部分修复

相关问题