0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AWS S3に写真をアップロード設定を行なっていた時のエラー

Posted at

20210512-114147.png

storage.yml
local:
  service: Disk
  root: <%= Rails.root.join("storage") %>

  amazon:
     service: S3
     region: ap-northeast-1
     bucket: tast123456
     access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
     secret_access_key:  <%= ENV['AWS_SECRET_ACCESS_KEY'] %>

インデントを揃えないとエラーが出る設定になっています。
上記だとservice: Diskと同じ並びになるのでlocal:の続きと読まれてしまう。

storage.yml
local:
  service: Disk
  root: <%= Rails.root.join("storage") %>

amazon:
  service: S3
  region: ap-northeast-1
  bucket: tast123456
  access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
  secret_access_key:  <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?