Error “uninitialized constant AWS (NameError)”

前端 未结 7 1765
梦毁少年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:23

    It sounds as though either the gem isn't present in your load path or it is not being required.

    The entry in your Gemfile should be

    gem 'aws-sdk'
    

    This will implicitly do a require 'aws-sdk' as the application initializes, as long as you start the app with bundle exec rails server or bundle exec rails console.

    Alternatively, if the above code was in a non-rails application, just place require 'aws-sdk' on the first line.

提交回复
热议问题