5
6

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 5 years have passed since last update.

uninitialized constant AWS::S3::Base の対処法

Last updated at Posted at 2014-04-17

aws-sdk なのか aws-s3 なのか?

AWS::S3::Base.establish_connection!(
  :access_key_id     => 'REPLACE_ME',
  :secret_access_key => 'REPLACE_ME'
)

こういうコード(ウェブにあったサンプル)書いて

uninitialized constant AWS::S3::Base

と怒られた。「gem で aws のライブラリインストールしてるのに何で?」

このコードは aws-s3 用のもので、昔からあった aws-s3 の後に Amazon が公式で出した aws-sdk の場合はちょっと違う書き方をする必要があるというもの。わかりにくい!

aws-sdk 使うときは↓を見る
http://docs.aws.amazon.com/AWSRubySDK/latest/frames.html

5
6
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
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?