active_campaign icon indicating copy to clipboard operation
active_campaign copied to clipboard

"Undefined method `dependency`" when requiring the gem

Open coalest opened this issue 2 years ago • 0 comments

After installing the gem locally from the master branch, when I try to require 'active_campaign' in an irb session I get the following error:

.../gems/active_campaign-3.0.0/lib/active_campaign/faraday/middleware/request.rb:12:in `<class:Request>':
undefined method `dependency' for ActiveCampaign::Faraday::Middleware::Request:Class (NoMethodError)

This is because I have a version of Faraday greater than 2.0 installed and the dependency method has been deprecated. (source).

To fix this I changed the gemspec to use Faraday 1 instead, which fixed the problem:

-  spec.add_dependency 'faraday',        '>= 1.0', '< 3.0'
+  spec.add_dependency 'faraday',        '>= 1.0', '< 2.0'

Could we upgrade the master branch to Faraday 2? I'm willing to submit a PR.

coalest avatar Aug 18 '22 08:08 coalest