gpt4 book ai didi

ruby-on-rails - Rails 6 升级中未初始化的常量 ActiveRecord::ConnectionAdapters::ConnectionManagement (NameError)

转载 作者:行者123 更新时间:2023-12-04 00:02:31 26 4
gpt4 key购买 nike

我目前正在将一个 Rails 项目从 v5.2.3 升级到 v6.0。我正在关注 guide升级 rails 。但我只停留在第一步。一旦我更改了 gemfile 中的 rails 版本并更新了 rails 就没有任何效果。运行 rails server 给我这个错误 uninitialized constant ActiveRecord::ConnectionAdapters::ConnectionManagement (NameError)

以下是完整的堆栈跟踪:

53: from bin/rails:4:in `<main>'
52: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
51: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
50: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
49: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
48: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
47: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<main>'
46: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
45: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
44: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
43: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
42: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
41: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `perform'
40: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `tap'
39: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
38: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:37:in `start'
37: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
36: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
35: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
34: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
33: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
32: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
31: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
30: from config.ru:in `<main>'
29: from config.ru:in `new'
28: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
27: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
26: from config.ru:3:in `block in <main>'
25: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require'
24: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
23: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
22: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
21: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
20: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
19: from /Volumes/gitdisk/PAC/codephod2/config/environment.rb:5:in `<main>'
18: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!'
17: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers'
16: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
15: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
14: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
13: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `call'
12: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each'
11: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
10: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
9: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
8: from /Users/shubham/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
7: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers'
6: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run'
5: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec'
4: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/airbrake-5.8.1/lib/airbrake/rails/railtie.rb:26:in `block in <class:Railtie>'
3: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
2: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
1: from /Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/Users/shubham/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant ActiveRecord::ConnectionAdapters::ConnectionManagement (NameError)

最佳答案

我遇到了同样的问题。我修复了它升级 airbrake gem

gem 'airbrake', '~> 10.0.3'

关于ruby-on-rails - Rails 6 升级中未初始化的常量 ActiveRecord::ConnectionAdapters::ConnectionManagement (NameError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57867028/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com