cloudinary / cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
https://cloudinary.com
420 stars 285 forks source link

2.0: Rake task fail with `LoadError` on `faraday/follow_redirects` #544

Closed DawidJanczak closed 5 months ago

DawidJanczak commented 5 months ago

Bug report for Cloudinary Ruby SDK

Before proceeding, please update to latest version and test if the issue persists

Describe the bug in a sentence or two.

After upgrading to 2.0 we cannot run any rake tasks because of this require: https://github.com/cloudinary/cloudinary_gem/blob/master/lib/tasks/cloudinary/fetch_assets.rake#L3 The whole rake task fails with

bin/rails aborted!
LoadError: cannot load such file -- faraday/follow_redirects (LoadError)
/usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
/usr/local/bundle/gems/cloudinary-2.0.0/lib/tasks/cloudinary/fetch_assets.rake:3:in `<main>'

Issue Type (Can be multiple)

Steps to reproduce

Add the library as a dependency scoped to version 2.0 and try to run any rake task in your project.

Error screenshots or Stack Trace (if applicable)

See above

Operating System

Environment and Libraries (fill in the version numbers)

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

wissam-khalili commented 5 months ago

Hi @DawidJanczak ,

Thank you for your feedback. We will review it and we will keep posted on our findings.

Regards, Wissam

damianlegawiec commented 5 months ago

This also breaks asset precompilation eg. during CI/deploy as it uses a rake task, so we cannot upgrade as well

rails aborted!
LoadError: cannot load such file -- faraday/follow_redirects
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/cloudinary-2.0.0/lib/tasks/cloudinary/fetch_assets.rake:3:in `<main>'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/cloudinary-2.0.0/lib/cloudinary/railtie.rb:3:in `load'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/cloudinary-2.0.0/lib/cloudinary/railtie.rb:3:in `block (2 levels) in <class:Railtie>'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/cloudinary-2.0.0/lib/cloudinary/railtie.rb:3:in `each'
/home/circleci/app/vendor/bundle/ruby/3.1.0/gems/cloudinary-2.0.0/lib/cloudinary/railtie.rb:3:in `block in <class:Railtie>'
const-cloudinary commented 5 months ago

Please try the latest version: https://github.com/cloudinary/cloudinary_gem/releases/tag/2.0.1

stephenhighemprise commented 5 months ago

This fix also worked for me today.