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
I have switched to Rails 7 and I found some issues when I upload image in my localhost. The system idles for 10/30 sec even for 5kb images, picture will be correctly loaded.
Furthermore the server is also very slow when deleting images.
I underline that this happens only in localhost, not production.
image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick #used for svg
storage :fog
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
version :thumb do
process resize_to_fit: [300, 300]
end
version :default do
process resize_to_fit: [900,900]
end
end
the issue is shown during uploads in my active admin page, with standard form uploader, in console and also in seeds.rb file.
Same happens with uploaders without any image processing.
The gems I'm using for upload are:
carrierwave (2.2.2)
fog-aws (3.13.0)
What I have tried:
removing versions generation (nothing changed)
using RMagick instead of MiniMagick (nothing changed)
using storage :file (the upload was really fast) It seems the issue is related to fog.
The bucket is on S3 and it is working very well with a rails 5 application.
My system is a last generation M1 MacBook pro.
The text was updated successfully, but these errors were encountered:
I have switched to Rails 7 and I found some issues when I upload image in my localhost. The system idles for 10/30 sec even for 5kb images, picture will be correctly loaded.
Furthermore the server is also very slow when deleting images.
I underline that this happens only in localhost, not production.
Here is my code: carrierwave.rb
CarrierWave.configure do |config|
config.fog_provider = "fog/aws"
config.fog_credentials = {
:provider => 'AWS', # required
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_ACCESS_KEY'],
:region => ENV['S3_REGION'] # optional, defaults to 'us-east-1' defaults to 'us-east-1'
}
config.fog_directory = ENV['S3_BUCKET'] # required
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
config.storage = :fog
image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick #used for svg
storage :fog
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
version :thumb do
process resize_to_fit: [300, 300]
end
version :default do
process resize_to_fit: [900,900]
end
end
the issue is shown during uploads in my active admin page, with standard form uploader, in console and also in seeds.rb file.
Same happens with uploaders without any image processing.
The gems I'm using for upload are:
carrierwave (2.2.2)
fog-aws (3.13.0)
What I have tried:
removing versions generation (nothing changed)
using RMagick instead of MiniMagick (nothing changed)
using storage :file (the upload was really fast) It seems the issue is related to fog.
The bucket is on S3 and it is working very well with a rails 5 application.
My system is a last generation M1 MacBook pro.
The text was updated successfully, but these errors were encountered: