提问人:Colibri 提问时间:11/5/2023 最后编辑:Colibri 更新时间:11/5/2023 访问量:61
ActiveSupport:Module 的未定义方法“deprecator”
undefined method `deprecator' for ActiveSupport:Module
问:
我有一个 Ruby gem 一直使用这一行,例如使用 和 方法:blank?
present?
require "active_support/core_ext/string"
最近有 Rails 的更新。我已更新到版本 7.1.1。此 gem 停止工作并立即返回此错误后:active_support
An error occurred while loading spec_helper.
Failure/Error: require "active_support/core_ext/string"
NoMethodError:
undefined method `deprecator' for ActiveSupport:Module
# ./lib/gemname.rb:5:in `<top (required)>'
# ./spec/spec_helper.rb:5:in `<top (required)>'
请告诉我,可能有什么问题?
几乎到处都有关于可可足类动物的讨论,但我不明白这与我的情况有什么关系。
通过用以下行替换它来解决此问题:
require "active_support/all"
但这是为什么呢?对于只需要几种特定方法的情况,这似乎不是最佳解决方案。
答: 暂无答案
评论
include "active_support/deprecator.rb"