8

पर संस्करण छवियों को अपलोड नहीं कर रहा है मैं एडब्ल्यूएस एस 3 पर छवियों को अपलोड करने के लिए आरएमएजिक के साथ कैरियरवेव 0.10.0 मणि का उपयोग कर रहा था। सब कुछ ठीक काम कर रहा था सिवाय इसके कि एडब्ल्यूएस एस 3 पर अपलोड करने में ज्यादा समय लग रहा था। इसलिए पृष्ठभूमि में छवियों को अपलोड करने के लिए वाहकवेव पृष्ठभूमि का उपयोग करना सोचा। मैंने कैरियरवेव बैकग्राउंडर स्थापित किया (0.4.2) लेकिन इस में मेरी मूल फ़ाइल हमेशा S3 पर अपलोड हो जाती है लेकिन उस छवि के संस्करण कभी भी S3 पर अपलोड नहीं होते हैं।कैरियरवेव पृष्ठभूमिकर्ता एडब्ल्यूएस एस 3

यहाँ मेरी carrierwave_backgrounder.rb

CarrierWave::Backgrounder.configure do |c| 
    c.backend :sidekiq, queue: :carrierwave 
end 

मैं sidekiq.rb

Sidekiq.configure_server do |config| 
config.redis = { :url => "redis://#{ENV['REDIS_ENDPOINT']}:6379", :namespace=> "#{ENV['REDIS_NAMESPACE']}" } 
config.options = 
queues: %w{ 
    critical 
    carrierwave 
    } 
}) 
end 

यहाँ में मेरी कतार परिभाषित किया है है मेरी photo_uploader.rb

class PhotoUploader < CarrierWave::Uploader::Base 
    include ::CarrierWave::Backgrounder::Delay 
    include CarrierWave::RMagick 
    storage :fog 

    def store_dir 
    "uploads/images/" 
    end 

    def filename 
    "#{secure_token}.#{file.extension}" if original_filename.present? 
    end 

    def orient_image 
    manipulate! do |img| 
     img.auto_orient 
     img 
    end 
    end 

    # Create different versions of your uploaded files: 
    version :thumb_small do 
    process :resize_to_fill => [100,100] 
    process :strip 
    end 

    def strip 
    manipulate! do |img| 
     img.strip! 
     img = yield(img) if block_given? 
     img 
    end 
    end 

    def extension_white_list 
    %w(jpg jpeg gif png) 
    end 

    def get_version_dimensions 
    model.width, model.height = `identify -format "%wx%h " #{file.path}`.split(/x/) 
    end 

    protected 
    def secure_token 
     var = :"@#{mounted_as}_secure_token" 
     model.instance_variable_get(var) || model.instance_variable_set(var, SecureRandom.hex(5)) 
    end 
end 

यहाँ है मेरी प्रोफ़ाइल है .rb फ़ाइल

mount_uploader :image_url, PhotoUploader 
process_in_background :image_url 

मैं sidekiq कार्यकर्ता इस आदेश

bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development 

का उपयोग करते समय मैं अपलोड image_url केवल मूल छवि अपलोड की गई है शुरू कर दिया है। यह मूल फ़ाइल अपलोड करने के बाद sidekiq लॉग है। लेकिन मुझे अपलोड की गई कोई भी संस्करण फ़ाइल नहीं दिखाई दे रही है। मैं S3 बाल्टी भी (कोई संस्करण फ़ाइल केवल मूल फ़ाइल) की जाँच की

2016-01-11T08:52:20.772Z 3983 TID-ownpyrrxk CarrierWave::Workers::ProcessAsset JID-91e3803d50defb2d1419cef1 INFO: start 
2016-01-11T08:52:31.119Z 3983 TID-ownpyrrxk CarrierWave::Workers::ProcessAsset JID-91e3803d50defb2d1419cef1 INFO: done: 10.347 sec 

वहाँ कुछ मुझे याद आ रही है।

careerwave_backgrounder रीडमी से:: मदद कृपया अग्रिम

+0

एक बग की तरह लगता है, क्या आपने मणि को डीबग करने का प्रयास किया था? इस तरह अजीब got'chas के लिए देखा? https://stackoverflow.com/questions/15490972/carrierwave-processed-images-not-uploading-to-aws-s3?rq=1 – bbozo

+0

@rohit kumar क्या आपको अभी भी यह समस्या है? मुझे अब इसका सामना करना पड़ रहा है और मुझे इसका समाधान नहीं है कि इसे कैसे हल किया जाए। पूरे दिन घूम रहा है लेकिन कुछ भी नहीं मिला। –

उत्तर

0

धन्यवाद कुछ दस्तावेजों के साथ जांच कर रही करने के बाद, यहाँ मेरी सुझाव है https://github.com/lardawge/carrierwave_backgrounder#background-options

इसकी स्पष्ट रूप से पता चलता है,

# This stores the original file with no processing/versioning. 
# It will upload the original file to s3. 

इस #113 से, लेखक ने कहा

I found a bug related to Rmagick but no issue with versions 

आप RMagick के बजाय MiniMagick/ImageMagick के साथ प्रयास कर सकते हैं।

प्रलेखन समान जारी करने के लिए देखने के लिए:

https://github.com/lardawge/carrierwave_backgrounder/issues/113

https://github.com/lardawge/carrierwave_backgrounder/issues/130

Rails CarrierWave versions are not created for some reason

धन्यवाद!

+0

ने मिनीमैजिक भी कोशिश की लेकिन एक ही समस्या। –

संबंधित मुद्दे