mardi 13 octobre 2015

Setting the aws_region in rails/amazon web services

I've installed the aws sdk with gem 'aws-sdk', '~> 2.1.29'. Upon entering the aws interactive console with aws.rb and trying to run commands I get the error:

Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']

I need help on how to set the AWS_REGION environment variable. At the console I have done:

heroku config:set S3_REGION='us-east-1'

and in config/initializers/carrier_wave.rb I have tried both

Aws.config.update({
  region: 'us-east-1'
})

and

S3Client = Aws::S3::Client.new(
  aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
  aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
  aws_region: 'us-east-1'
)

but to no avail. (I have set the access key id and secret access key at the console also).




Aucun commentaire:

Enregistrer un commentaire