2016-10-19 16 views
2

私はレールアプリケーションを構築しており、ダイナモイドを使用してデータベースとしてdynamoDBを使用しています。 私がテストを実行している間、私は次のエラーを取得する:Aws :: Errors :: MissingCredentialsError:資格情報が設定されていないリクエストに署名できません

Aws::Errors::MissingCredentialsError:unable to sign request without credentials set

テストは地元DynamoDBの中で実行されているので、私はこのエラーメッセージの上に少し混乱しています。私のテストはローカルDBで実行されておらず、リモートDBにアクセスしようとしていますか?

答えて

2

以下の設定をローカルdynamodbに使用できます。 localhostエンドポイントを指定すると、dynamodbはregionからエンドポイントを派生させるのではなく、エンドポイントを直接使用します。

Aws.config.update({ 
    region: 'us-west-2', 
    credentials: Aws::Credentials.new('akid', 'secret'), 
    endpoint:'http://localhost:8000' 
}) 

The region is used to construct an SSL endpoint. If you need to connect to a non-standard endpoint, you may specify the :endpoint option.

関連する問題