Ruby on Rails #21 Active Storage With Amazon S3 Cloud Storage

Sdílet
Vložit
  • čas přidán 8. 05. 2024
  • aws s3 for file storage:
    github.com/corsego/20-active_...
    ActiveStorage docs:
    edgeguides.rubyonrails.org/ac...
    How to use Credentials in Ruby on Rails 6? TLDR:
    blog.corsego.com/ruby-on-rail...
    0:00 The Problem
    02:01 Install AWS S3 cloud storage
    05:19 AWS IAM
    08:35 Local storage = S3
    09:13 gem aws-sdk-s3
    11:05 Production
    15:42 Summary

Komentáře • 34

  • @isaacchuah7543
    @isaacchuah7543 Před 3 lety +2

    Clear and concise. Thank you so much!

  • @ogarocious11
    @ogarocious11 Před 2 lety

    You're videos are so great for a newbie coder like me! I'm building my first app and was able to follow along easily! Many thanks!

  • @martinkarkovich3037
    @martinkarkovich3037 Před 2 lety +1

    Great video! Very easy to understand and follow!

  • @wmcraver
    @wmcraver Před rokem

    I just have to say that every time I get stuck with something, I come to your channel to see if you have a video. It never fails that you've already covered the question that I have! I'm grateful that you walked us through the S3 bucket creation . Everyone else glosses over those details like I should already know which settings should be selected.

  • @shuya4
    @shuya4 Před rokem

    Your channel is actually amazing. I've been hitting my head for days on it. Following your video, i made it work in less than an hour. Huge thanks

  • @enjoythements777
    @enjoythements777 Před 3 lety +1

    Great video serie!!

  • @StrikerSixterGamer
    @StrikerSixterGamer Před rokem

    thanks for the video!

  • @210779paul
    @210779paul Před rokem

    Very nice and helpful video, Thank a lot :)

  • @haroldpepete
    @haroldpepete Před 2 lety

    Great video my friend, i'm a rails lover

  • @yostin1717
    @yostin1717 Před 2 lety +1

    loved it!!!! thankuu, subbed!

  • @ledockol
    @ledockol Před 3 lety +1

    Thanks!

  • @NekoManAICore
    @NekoManAICore Před rokem

    thx

  • @Prohor21
    @Prohor21 Před 2 lety +2

    Perfect!

    • @SupeRails
      @SupeRails  Před 2 lety +1

      Hello Evgenii! Glad that you found the video useful!

  • @MalachiAsgharian
    @MalachiAsgharian Před rokem

    Epic.

  • @moran_riv
    @moran_riv Před 2 lety +1

    perfect¡¡

    • @SupeRails
      @SupeRails  Před 2 lety

      Thanks! If you have any ideas for upcoming episodes - please share them!

  • @kwhandy
    @kwhandy Před 2 lety +1

    do you have video that explain to delete orphaned image file after upload

  • @acmapps4118
    @acmapps4118 Před rokem

    Hello. I followed your video, however Heroku doesnt take amazon as storage service. It take local configuration. My production.rb has config.active_storage.service = :amazon and i have my credentials set up ok. do you have an idea what is the problem?

  • @anastaciomegalordepatricio8342

    What if we want to save our images in a specific folder/directory inside the bucket ? how we would go about that in rails ? thanks in advance.

    • @SupeRails
      @SupeRails  Před 2 lety +1

      Good question. I haven't researched it before. The easy way - different buckets for different info. It wouldn't really increase your aws cost. You can override where a file is saved like "has_one_attached :avatar, service: :s3"

  • @tone9270
    @tone9270 Před rokem

    I'm having a problem, when i do rails credentials:edit it opens an empty yml file but when I do credentials:show it shows me the default aws stuff so it isn't opening correct file. Can someone help me?

  • @Pacowinelover
    @Pacowinelover Před rokem

    Hero without cape

  • @anastaciomegalordepatricio8342

    Good tutorial ! But i keep getting an error in uploading in the xml response. "The request signature we calculated does not match the signature you provided. Check your key and signing method." "SignatureDoesNotMatch" seems like a key/secret error but i have changed it to newer ones and the issue persists atm

    • @SupeRails
      @SupeRails  Před 2 lety +1

      Did you update CORS?

    • @anastaciomegalordepatricio8342
      @anastaciomegalordepatricio8342 Před 2 lety

      @@SupeRails yes i've added on my bucket -> Security a json for it.
      [
      {
      "AllowedHeaders": [
      "*"
      ],
      "AllowedMethods": [
      "GET",
      "HEAD"
      ],
      "AllowedOrigins": [
      "*"
      ],
      "ExposeHeaders": [],
      "MaxAgeSeconds": 3000
      }
      ]

    • @anastaciomegalordepatricio8342
      @anastaciomegalordepatricio8342 Před 2 lety

      also i didn't deploy to heroku, i wanted to try in ENV=Development first. I followed along all your steps and somehow got a different outcome so far

    • @SupeRails
      @SupeRails  Před 2 lety

      stackoverflow.com/a/62137151/5695646

    • @anastaciomegalordepatricio8342
      @anastaciomegalordepatricio8342 Před 2 lety

      @@SupeRails so i found out my issue and it was whit the CORS. Notice on the reply here i wasn't allowing any "POST","PUT" or "Delete" methods and they are needed. Ill leave my CORS file in here hope it helps.
      [
      {
      "AllowedHeaders": [
      "*"
      ],
      "AllowedMethods": [
      "GET",
      "HEAD",
      "POST",
      "PUT",
      "DELETE"
      ],
      "AllowedOrigins": [
      "*"
      ],
      "ExposeHeaders": []
      }
      ]

  • @ahmedmunir5128
    @ahmedmunir5128 Před 2 lety +1

    first of all thank you for your great video
    but what if i want to upload photos in subdirectories at AWS, for example:
    photos/user_id/profile_photo.jpeg
    how to do this using active storage?

    • @SupeRails
      @SupeRails  Před 2 lety

      That's a tough one. Instead of sub-directories, I would maybe just use different AWS buckets... Anyway, did you find an answer? Now I'm curious!

    • @barkbark5645
      @barkbark5645 Před 2 lety +1

      @@SupeRails You can't do it. I remember this being an issue when Active Storage first came out. Then someone from Rails Core, or Basecamp, said they will not do anything to make it work with folders. Also, thanks for the video.