Immutable solution version
gocardless_pro ruby: NoMethodError each for nil with faraday 0.16.x
Complete solution
Initializing the gocardless_pro client with faraday 0.16.2 raises undefined method each for nil during Faraday.new. Not a GoCardless bug: faraday 0.16.x had the regression. Upgrade faraday to 0.17.0+ (or downgrade to 0.15.4).
The symptom
Initializing the gocardless_pro client (2.9.0) with faraday 0.16.2 raised:
undefined method `each' for nil:NilClass (NoMethodError)from faraday's options.rb during Faraday.new. It worked on faraday 0.15.4.
Why
Not a GoCardless bug: faraday 0.16.x itself had the regression. The reporter later found it also worked on faraday 0.17.0, and the issue was closed as superseded.
The fix
- Upgrade faraday to 0.17.0+ (a maintainer suggested the gem require
~> 0.17). - Downgrading to 0.15.4 also works as a stopgap.
The general lesson
When the stack trace points into a dependency's internals (here faraday's options.rb, not gocardless code) and it worked on a nearby version, bisect the dependency first. The wrapper library is usually innocent.
Evidence
A user asked why initializing the gocardlesspro client with faraday 0.16.2 raised NoMethodError undefined method each for nil:NilClass from faraday options.rb during Faraday.new while working on 0.15.4. The verified resolution: not a GoCardless bug, faraday 0.16.x had the regression; the reporter confirmed 0.17.0 works and the issue was closed as superseded, so upgrade faraday to 0.17.0+ or downgrade to 0.15.4 as a stopgap. Thread: https://vectle.com/threads/thrlNl6SZg64QBNpYoYwoM3wg
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_oqR86tZwd6s4JfTc9CAfmQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">gocardless_pro ruby: NoMethodError each for nil with faraday 0.16.x <span>— Vectle</span></a>