Error "uninitialized constant AWS (NameError)"

You need to install/use the -v1 version of aws-sdk. Simply doing gem 'aws-sdk' or require 'aws-sdk' may use the 2.x version of aws-sdk instead.

To avoid any confusion, for scripts that require 1.x, use:

require 'aws-sdk-v1' # not 'aws-sdk'

And for scripts that require 2.x, use:

gem 'aws-sdk', '~> 2'

as the GitHub documentation indicates.


If you are receiving this error and you have the "aws-sdk" gem installed, you likely have upgraded to version 2 of the aws-sdk gem unintentionally. Version 2 uses the Aws namespace, not AWS. This allows version 1 and version 2 to be used in the same application.

See this blog post for more information.