Error “uninitialized constant AWS (NameError)”

前端 未结 7 1790
梦毁少年i
梦毁少年i 2021-02-06 21:39

It is saying AWS is uninitialized. I am usign the aws-sdk-core gem.

I tried using the aws-sdk gem instead, and the problem was still there.

This is the initializ

7条回答
  •  广开言路
    2021-02-06 22:14

    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.

提交回复
热议问题