Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWSの環境をセットする. #16

Open
kanekou opened this issue Aug 21, 2020 · 5 comments
Open

AWSの環境をセットする. #16

kanekou opened this issue Aug 21, 2020 · 5 comments
Assignees

Comments

@kanekou
Copy link
Owner

kanekou commented Aug 21, 2020

関連issue

#12

背景

herokuにappをデプロイしたが,画像はそのままだと消えてしまうため,S3に保存するように設定する.

期待される効果

  • 画像を保存するとS3に保存される.
  • S3から画像をひっぱり出すことができる.
@kanekou kanekou self-assigned this Aug 21, 2020
@kanekou
Copy link
Owner Author

kanekou commented Aug 21, 2020

大まかにやること

  • S3の準備
  • app側の設定
  • heroku側の設定
  • デプロイし,動作確認

@kanekou
Copy link
Owner Author

kanekou commented Aug 21, 2020

参考サイト

@kanekou kanekou mentioned this issue Aug 21, 2020
@kanekou
Copy link
Owner Author

kanekou commented Aug 23, 2020

エラー
uninitialized constant Aws

gem 'aws-sdk', '~> 2'を再度インストールし,

    @s3 = Aws::S3::Resource.new(
      region: 'ap-northeast-1', # リージョン東京
      credentials: Aws::Credentials.new(
          ENV['AWS_S3_ACCESS_KEY_ID'], # S3用アクセスキー
          ENV['AWS_S3_SECRET_ACCESS_KEY'] # S3用シークレットアクセスキー
      )
    )

と呼び出してみたもののエラー.

@kanekou
Copy link
Owner Author

kanekou commented Oct 24, 2020

bundle exec ruby app.rbとすべきだった
https://qiita.com/xusaku_/items/96632733200b268d4dd9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant