这段话的意思是AWS未初始化,使用了aws-sdk-core gem。我尝试使用aws-sdk gem,但问题仍然存在。这是初始文件initializers/aws.rb:
AWS.config(:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'])
s3 = AWS::S3.new
AVATAR_BUCKET = s3.buckets[ENV['AVATAR_BUCKET_NAME']]
当我尝试运行服务器或打开控制台时,我会遇到这个错误:
/initializers/aws.rb:1:in `': uninitialized constant AWS (NameError)
/initializers/aws.rb:1:in `': uninitialized constant AWS (NameError)
gem install aws-sdk-v1
和require aws-adk-v1
。 - SJP