Skip to content

Commit 81a6c72

Browse files
committed
[DOCS] Updates Troubleshooting for adapters information
1 parent 3cdf602 commit 81a6c72

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/troubleshooting.asciidoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ When working with multiple hosts, you might want to enable the `retry_on_failure
2121

2222
For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections, such as https://github.com/toland/patron[patron] or https://github.com/typhoeus/typhoeus[Typhoeus]. Require the library (`require 'patron'`) in your code for Faraday 1.x or the adapter (`require 'faraday/patron'`) for Faraday 2.x, and it will be automatically used.
2323

24+
[discrete]
25+
=== Adapter is not registered on Faraday
26+
27+
If you see a message like:
28+
```
29+
:adapter is not registered on Faraday::Adapter (Faraday::Error)
30+
```
31+
32+
Then you probably need to include the adapter library in your Gemfile and require it. You might get this error when migrating from Faraday v1 to Faraday v2. The main change when using Faraday v2 is all adapters, except for the default `net_http` one, have been moved out into separate gems. This means if you're not using the default adapter and you migrate to Faraday v2, you'll need to add the adapter gems to your Gemfile.
33+
34+
These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
35+
36+
[source,ruby]
37+
------------------------------------
38+
# HTTPCLient
39+
gem 'faraday-httpclient'
40+
41+
# NetHTTPPersistent
42+
gem 'faraday-net_http_persistent'
43+
44+
# Patron
45+
gem 'faraday-patron'
46+
47+
# Typhoeus
48+
gem 'faraday-typhoeus'
49+
------------------------------------
50+
51+
Things should work fine if you migrate to Faraday 2 as long as you include the adapter (unless you're using the default one `net-http`), but worst case scenario, you can always lock the version of Faraday in your project to 1.x:
52+
`gem 'faraday', '~> 1'`
53+
54+
Be aware if migrating to Faraday v2 that it requires at least Ruby `2.6`, unlike Faraday v1 which requires `2.4`.
55+
2456
[discrete]
2557
=== More Help
2658

0 commit comments

Comments
 (0)