相关疑难解决方法(0)

LocationsController#create 中的 AWS::Errors::MissingCredentialsError 使用回形针和 aws Gem

我在使用回形针和 AWS gem 的 LocationsController#create 中收到以下错误AWS::Errors::MissingCredentialsError

有关异常的更多详细信息:

Missing Credentials. Unable to find AWS credentials. 
You can configure your AWS  credentials a few different ways: 
* Call AWS.config with :access_key_id and :secret_access_key 
* Export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to ENV * 
Run Code Online (Sandbox Code Playgroud)

我目前正在我的机器上的开发环境中运行此代码这是development.rb

  Gmaps::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails amazon-s3 amazon-web-services

5
推荐指数
1
解决办法
1万
查看次数

如何使用Paperclip和rails 3中的s3存储解决"缺少证书"

我有一个非常简单的模型和附件

has_attached_file :upload,
    :storage => :s3,
       :bucket => 'bestofbauer',
       :s3_credentials => {
         :access_key_id => ENV['MyAccessKEY'],
         :secret_access_key => ENV['MySecretKey']
       }
Run Code Online (Sandbox Code Playgroud)

我有一个名为bestofbauer的s3桶设置.

我知道我可以将凭证重构为初始化程序,但我还没有得到这个来保存附件,所以我并不担心它.

当我运行对象及其附件的保存时,我得到:

RuntimeError in RecommendationsController#create

Missing credentials
Run Code Online (Sandbox Code Playgroud)

我已经倾倒了:使用Paperclip和Amazon s3上传照片时缺少证书,但这并没有解决我的问题.

我使用以下宝石:

gem "paperclip"
gem "sws-sdk"
gem 'aws-s3'
Run Code Online (Sandbox Code Playgroud)

还有其他想法吗?

amazon-s3 ruby-on-rails-3

4
推荐指数
1
解决办法
5515
查看次数