I ran bundler update
on my rails 6 project and now see the following deprecation notice when I run rails console
. Anyone know off hand which is the offending combo of incompatible gem/ruby version?
Deprecation Notice:
root@1ddbacaf4a69:/app# bin/rails c
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
Ruby version: 3.1.2
Google and github has not been too much help. I don't want to start disabling gems one at a time to figure it out.
CodePudding user response:
UPDATE:
TLDR; this error is most commonly caused by faraday-multipart
dependency on multipart-post
. faraday-multipart
has released a fix for this - simply upgrading the gem to 1.0.4 or newer should resolve this issue.
================
Further digging, I found the offending piece of code:
multipart-post/lib/composite_io.rb:
warn "Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!"
Which is being used by:
Gemfile.lock:
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
...
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
Which leads me to this issue: https://github.com/lostisland/faraday-multipart/issues/5
Bottom line answer - there is a fix for this which should be merged and released in a few days. bundle update
again and this should go away when faraday libraries are updated.