Rephrased AWS an Imagemagick

20 views
Skip to first unread message

David Merrick

unread,
Jan 16, 2019, 2:38:41 AM1/16/19
to Ruby on Rails: Talk
Hi I have a web app test running on Amazon Cloud 9. The users using the website have the ability to up load images. They currently can't do it. as I can't install ImageMagic let along the gem.

I there something else I can use that is the AWS Libraries?

Any suggestions.

Cheers Dave

fakt...@gmail.com

unread,
Jan 23, 2019, 11:44:09 PM1/23/19
to Ruby on Rails: Talk
Dave,

I believe you can utilize 'carrierwave' and the 'fog-aws' gems to get what you are looking for a solution without ImageMagick:

gem 'fog-aws'
https://github.com/fog/fog-aws

This is what I most recently used to upload to S3 but I think all AWS server sets can be worked with... you setup an initializer file for Carrierwave like

CarrierWave.configure do |config|
  config.fog_provider = 'fog/aws'
  config.fog_credentials = {
    provider:              'AWS',
    aws_access_key_id:     ENV['S3_ACCESS_KEY'],
    aws_secret_access_key: ENV['S3_SECRET_KEY'],
    use_iam_profile:       false,
    region:                'us-west-2',                  # optional, defaults to 'us-east-1'
  }
  config.fog_directory  = ENV['S3_BUCKET']
  config.fog_public     = false
  config.fog_attributes = { cache_control: "public, max-age=#{365.days.to_i}" } # optional, defaults to {}
end

Use the Carrierwave Uploader generator to create your rails uploader and change the storage to storage :fog in the uploader created.

Let me know if you have any questions... checkout the 'fog-aws' documentation for specifics on Amazon and setup with Carrierwave for your implementation.

-Zaven

David Merrick

unread,
Jan 24, 2019, 3:24:22 AM1/24/19
to Ruby on Rails: Talk
Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6521b3f7-1f61-4270-8e93-001bc28b8a1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Dave Merrick

Daves Web Designs

Website http://www.daveswebdesigns.co.nz

Email merri...@gmail.com

Ph   03 216 2053

Cell 027 3089 169
Reply all
Reply to author
Forward
0 new messages