You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First, thank you for keeping updating this cool gem.
I think we have found a bug, probably related to Rails Zeitwerk mode, where we get NameError, when we use Paperclip to store or update PDF files.
When we try to assign a document to a record with Paperclip attachment: bill.update document: pdf_document
We will see this error:
NameError: uninitialized constant Paperclip::Storage::Fog::Excon
from .bundle/ruby/3.0.0/gems/kt-paperclip-7.1.1/lib/paperclip/storage/fog.rb:120:in `rescue in block in flush_writes'Caused by NameError: uninitialized constant Fogfrom .bundle/ruby/3.0.0/gems/kt-paperclip-7.1.1/lib/paperclip/storage/fog.rb:232:in `connection'
I also tried to activate config.autoloader = :classic mode, bud got the same error.
After adding gem "fog-aws", "~> 3.15.0", I got a new error:
TypeError: wrong argument type Class (expected Module)
from /home/nonroot/.bundle/ruby/3.0.0/gems/kt-paperclip-7.1.1/lib/paperclip/attachment.rb:425:in `extend'
Additional context
We are in process to upgrade old application from Rails 5 to 6.1 and Ruby 2.5.x to 3.0.4.
We followed Rails Guides, in order to upgrade, e.g.:
I just tried to update to the latest version of kt-paperclip and aws-sdk-s3. On our review Heroku instance, it works now! But I get this error in local environment (macOS 12.5.1 or Docker Alpine).
Because I do not have credentials for S3 bucket, I tried with defaults from README, where storage: :fog is set to fog. And maybe this is the issue here?!
Describe the bug
First, thank you for keeping updating this cool gem.
I think we have found a bug, probably related to Rails Zeitwerk mode, where we get NameError, when we use Paperclip to store or update PDF files.
When we try to assign a document to a record with Paperclip attachment:
bill.update document: pdf_document
We will see this error:
See https://github.com/kreeti/kt-paperclip/blob/master/lib/paperclip/storage/fog.rb#L120
I also tried to activate
config.autoloader = :classic
mode, bud got the same error.After adding
gem "fog-aws", "~> 3.15.0"
, I got a new error:See https://github.com/kreeti/kt-paperclip/blob/master/lib/paperclip/attachment.rb#L425
So, I have no idea, how to solve it.
Additional context
We are in process to upgrade old application from Rails 5 to 6.1 and Ruby 2.5.x to 3.0.4.
We followed Rails Guides, in order to upgrade, e.g.:
https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#autoloading
https://edgeguides.rubyonrails.org/classic_to_zeitwerk_howto.html
https://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html
The text was updated successfully, but these errors were encountered: