Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【fog-backblaze】undefined method `copy_object' for <Fog::Backblaze::Storage::Real:0x00007f9dae8b3b18> #2528

Closed
dsfwoo8172 opened this issue Jan 13, 2021 · 1 comment

Comments

@dsfwoo8172
Copy link

environment
rails : 6.0.3.4
carrierwave : 2.1.0
fog-backblaze : 0.3.0

I tried to use fog-backblaze as a provider.
But when I upload images, undefined method copy_object error occurred.

My settings in config/initializers/carrierwave.rbare like below

CarrierWave.configure do |config|
  config.fog_credentials = {
    provider: ENV['service'],
    b2_key_id: ENV['key_id'],
    b2_key_token: ENV['key_token']
  }
  config.fog_directory = ENV['bucket_name']
  config.fog_public = true
end

and my uploader

class ImageUploader < CarrierWave::Uploader::Base

include CarrierWave::MiniMagick

storage :fog

def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

process resize_to_fit: [200,200]
end

can u help me ? thank you !! @

@mshibuya
Copy link
Member

It's fixed now, since #2583 changed to use File#copy which is also implemented in Fog::Backblaze::Storage::File.
https://github.com/fog/fog-backblaze/blob/e6d8445fc97133e927f920616408196e6c2ecc78/lib/fog/backblaze/storage/models/file.rb#L65

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

No branches or pull requests

2 participants