Skip to content

Do not use Faraday v2#6

Closed
daipom wants to merge 1 commit intomasterfrom
do-not-use-faraday-v2
Closed

Do not use Faraday v2#6
daipom wants to merge 1 commit intomasterfrom
do-not-use-faraday-v2

Conversation

@daipom
Copy link
Copy Markdown

@daipom daipom commented Apr 15, 2025

We can't use Faraday v2 if we use the adapter in Typhoeus.

typhoeus/typhoeus#582

It causes the following error:

in `remove_method': method `call' not defined in Faraday::Adapter::Typhoeus (NameError)
  remove_method :call              if method_defined? :call

We can't use Faraday v2 if we use the adapter in Typhoeus.

typhoeus/typhoeus#582

It causes the following error:

    in `remove_method': method `call' not defined in Faraday::Adapter::Typhoeus (NameError)
      remove_method :call              if method_defined? :call
@Watson1978 Watson1978 mentioned this pull request Mar 9, 2026
@kou kou closed this in #7 Mar 9, 2026
Watson1978 added a commit to Watson1978/ruby-zulip-client that referenced this pull request Mar 9, 2026
This PR upgrades the faraday dependency from 1.x to 2.x and resolves
several breaking changes.

Currently, this library is running the test suite fails with a
`NameError` because the older `typhoeus` gem attempts to modify
Faraday's internal adapter classes using a legacy structure that is no
longer compatible with Faraday 2.x.

```
$ bundle exec rake test
/home/watson/.rbenv/versions/3.4.8/bin/ruby -w -I"lib:test" /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb "test/test_client.rb"
/home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:28:in 'Module#remove_method': method 'call' not defined in Faraday::Adapter::Typhoeus (NameError)

      remove_method :call              if method_defined? :call
      ^^^^^^^^^^^^^
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:28:in '<class:Typhoeus>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:21:in '<class:Adapter>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:4:in '<module:Faraday>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:3:in '<top (required)>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /home/watson/src/ruby-zulip-client/lib/zulip/client.rb:5:in '<top (required)>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /home/watson/src/ruby-zulip-client/test/helper.rb:4:in '<top (required)>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /home/watson/src/ruby-zulip-client/test/test_client.rb:1:in '<top (required)>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:21:in 'block in <main>'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in 'Array#select'
        from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in '<main>'
rake aborted!
```

This PR will migrate to 2.x to resolve the above error.

Fix clear-code#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant