mongoid ::标准可以修改冷冻字符串
这使我感到困惑。 mongoid ::标准不是冷冻的,但是如果我将其分配给控制台的变量,它会告诉我frozenerror(无法修改冷冻字符串:“#< mongoid :: criteria
为什么 ,我该如何修复?
是 rails(〜> 6.0.0)
This perplexes me. A Mongoid::Criteria is not frozen, but if I assign it to a variable in console, it tells me FrozenError (can't modify frozen String: "#<Mongoid::Criteria
Why would that be, and how do I fix it?
mongoid (~> 7.3.0)
rails (~> 6.0.0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在IRB回购中发现了这个问题: https://github.com/ruby.com/ruby/irb/irb/issues/ 136 。
这意味着该问题是在以后版本的IRB中解决的,因此我的建议是强制IRB版本高于2.8的IRB版本以获取修复。
只需将
gem'Irb',&gt; = 1.2.8'
添加到您的gemfile,然后测试它与当前的Ruby版本一起使用。I found this issue in IRB repo: https://github.com/ruby/irb/issues/136.
It means the issue was fixed in a later version of IRB, so my suggestion is to force IRB version higher than 2.8 to get the fix.
Just add
gem 'irb', '>= 1.2.8'
to your gemfile and test that it works with your current Ruby version.