- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在将一个 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/
我想知道如何使用 CaSTLe AR 来“播种”自动递增的主键值?例如,希望 Orders 表的主键从 10000 开始。这是 1. 可能的 2. 创建订单号的好解决方案吗? 也许有一种方法可以在不是
假设你想 records = Model.all records.to_a.map{|m| m.serializable_hash(:root => true)} 就像 to_json(:root =
我目前正在尝试开发一个插件/gem 来观察多个模型。理想情况下,观察者应该只用一个单例方法自动实例化...... class MyModel true observe ActiveRecord:
使用 Mysql 我可以使用 COALESCE仅更新表中为空的值。 我怎样才能用 Rails (ActiveRecord) 做到这一点? 我不想创建 if表中每一列的语句,我猜如果我将 ActiveR
我从 Yii2 开始,想要将一些内容保存到我的数据库中。这是我的模型: class Course extends ActiveRecord { public $name; public
我正在开始一个新项目,最近我发现了 caSTLe 项目 activerecord,这似乎是一个很棒的解决方案,但与此同时,它看起来确实是非常规的。我想知道,这种感觉是来自学习新东西(我应该习惯它)还是
不知何故,我总是在周五收到这些。 我之前的问题是关于同样的问题,但我现在可以缩小范围: 我一整天都在研究这个问题,试图理解它。我有一个带有 lock_version 列的表,如此指定: add_col
我正在使用表中缓存的关键字构建搜索。在表中查找用户输入的关键字之前,它会被规范化。例如,删除了一些标点符号,如“-”,并标准化了大小写。然后使用规范化的关键字来查找获取搜索结果。 我目前正在使用 be
我有以下类用于“项目”和“颜色”之间的多对多关系。 并且“项目”不应该有重复的“颜色”,例如:-如果“Item1”有“Blue”和“Red”,那么我们不能向“Item1”添加另一个“Red” 这是正确
我对 Yii2 事件记录处理关系属性的方式感到困惑。是否可以将事件记录对象链接到另一个对象而不先保存它? 例如,我想将图像作为 Logo 添加到公司记录中,但尚未决定是否应保存这两个记录。给定一家公司
我决定使用 Castle ActiveRecord 为客户制作一个系统,一切都很顺利,直到我发现交易不起作用,例如; TransactionScope t = new T
Yii2 的新特性。 只是试图从 ActiveRecord 查询中获得返回。我意识到使用 Yii2 约定可能有更简单的方法来做到这一点 public function actionGet_permis
我收到一个错误(在 Sinatra + ActiveRecord Heroku 上)数据库配置没有指定适配器。 根据一些研究,这似乎是因为 Heroku 预计在 rackup 期间不使用环境变量。 我
我正在尝试按“created_at”日期查找记录 - 数据库列类型为“日期时间”并且 我正在使用来自 jQuery 的 UI DatePicker 我的网址如下所示:“localhost:3000/u
我想问这个问题。但我认为 BlameableBehavior和 TimestampBevavior可能是需要这样做的好例子: 我必须做什么才能使属性只能从 ActiveRecord 对象的外部读取而不
这是一个古老的问题,其中给定一个具有“类型”、“品种”和“价格”属性的表,您可以获取每种类型的最低价格的记录。 在 SQL 中,我们可以做 this通过: select f.type, f.varie
这似乎是一个微不足道的问题,但是我能想到的所有明显的解决方案都有自己的缺陷。 我们想要的是能够为新记录设置任何默认的 ActiveRecord 属性值,以使其在验证之前和期间可读并且不干扰用于搜索的派
做关联方法,比如has_many定义的那些和 belongs_to利用 ActiveRecord::Relation ? 如果是这样,是否有可能获得 ActiveRecord::Relation正在使
如何将 MySQL 的 WHERE 转换为 ActiveRecord :condition? SELECT * FROM users WHERE LENGTH(users.last_name) [
当使用带有 ActiveRecord T4 模板的 SubSonic 3 时,生成的代码会显示许多关于 CLS 合规性、未使用的项目和缺少 GetHashCode() 实现的警告。 为了避免它们,我做
我是一名优秀的程序员,十分优秀!