简体   繁体   中英

NameError uninitialized constant Aws::SES

I am using a Rails code (using AWS SDK) to do the following:

  1. Upload a file to an S3 bucket
s3 = Aws::S3::Client.new(
    access_key_id: <my key>,
    secret_access_key: <my secret key> 
   )
s3.put_object(bucket: <my bucket>, key: <file name>, body: <file content>)
  1. Send an email to the user stating that the file has been uploaded to S3 bucket
ses = Aws::SES::Client.new(region: 'us-west-2')

While step 1 works perfectly fine, I am getting this error when I try to instantiate the SES client in step# 2:

NameError uninitialized constant Aws::SES

Why AWS::Ses is giving a namespace error while Aws::S3 is working perfectly fine? Please help!

These are the related gems I am using:

aws-ses
aws-sdk-3

Please add gem 'aws-sdk-ses'

for more info check here https://rubygems.org/gems/aws-sdk-ses/versions/1.6.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM