I have updated rails version from rails 7.0 to rails 6.0.4.6 and then when I try to run server it's showing me following error. What should I do?

Viewed 400
Traceback (most recent call last):
    20: from bin/rails:4:in `<main>'
    19: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    18: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    17: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/commands.rb:18:in `<main>'
    16: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/command.rb:46:in `invoke'
    15: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/command/base.rb:69:in `perform'
    14: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    13: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    12: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    11: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/commands/server/server_command.rb:138:in `perform'
    10: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/commands/server/server_command.rb:138:in `tap'
     9: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/commands/server/server_command.rb:141:in `block in perform'
     8: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.6/lib/active_support/dependencies.rb:324:in `require'
     7: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.6/lib/active_support/dependencies.rb:291:in `load_dependency'
     6: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.6/lib/active_support/dependencies.rb:324:in `block in require'
     5: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
     4: from /home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
     3: from /home/laxmipasi/Documents/projects/DailyWork/config/application.rb:9:in `<main>'
     2: from /home/laxmipasi/Documents/projects/DailyWork/config/application.rb:11:in `<module:DailyWork>'
     1: from /home/laxmipasi/Documents/projects/DailyWork/config/application.rb:12:in `<class:Application>'
/home/laxmipasi/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/railties-6.0.4.6/lib/rails/application/configuration.rb:160:in `load_defaults': Unknown version "7.0" (RuntimeError)
2 Answers

It looks to me that the rails project hasn't been upgraded to version 7.0 correctly.

Could you check to see what version your gemfile says and review the steps you took to upgrade?

go to the config folder, enter the boot.rb, change to 6, this will fix the problem, this would be the last piece of set up, if you have not already bundle installed already.

Related