I understand there are other questions that are the same, but they have no solved my problem.
I keep on receiving the error: Aws::Errors::MissingRegionError in BooksController#create
,
missing region; use :region option or export region name to ENV['AWS_REGION']
. However, this is my configuration in my
Development.rb:
config.paperclip_defaults = {
storage: :s3,
s3_host_name: "s3-us-west-2.amazonaws.com",
s3_credentials: {
bucket: ENV['AWS_BUCKET'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
s3_region: ENV['us-west-2']
}
}
Production.rb:
config.paperclip_defaults = {
storage: :s3,
s3_host_name: "s3-us-west-2.amazonaws.com",
s3_credentials: {
bucket: ENV['AWS_BUCKET'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
s3_region: ENV['us-west-2']
}
}
And Application.rb:
config.paperclip_defaults = {
storage: :s3,
s3_host_name: "s3-us-west-2.amazonaws.com",
s3_credentials: {
bucket: ENV['AWS_BUCKET'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
s3_region: ENV['us-west-2']
}
}
However, it keeps coming up with the error. I have followed other people's advice from other questions. Hope someone can help.
Ben