I have a Ruby gem that uses this line all the time, for example to work with the blank? and present? methods:
require "active_support/core_ext/string"
Recently there was an update for Rails. I updated active_support to version 7.1.1. After this gem stopped working and immediately returns this error:
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)>'
Tell me, please, what could be the problem?
Almost everywhere there is a discussion about cocoapods, but I don’t understand how this can be related to my case.
The problem is solved by replacing it with this line:
require "active_support/all"
But why is that? This does not seem to be the best solution for cases where only a few specific methods are needed.