1

使用 FOG 和 AWS 时,我突然出现以下错误:

The following keys are invalid: :scheme, :host
Expected(200) <=> Actual(403 Forbidden)

执行捆绑更新后发生此错误。我只是不明白它突然出了什么问题。

fog_connection = Fog::Storage.new({:provider => 'AWS',:aws_access_key_id => CUBE_CONF['aws']['access_key'],:aws_secret_access_key => CUBE_CONF['aws']['secret_key'],:region => 'eu-west-1'})

  puts "VideoEntryPandaWorker: established connection with S3"
  # setting the directory
  fog_directory = fog_connection.directories.new(:key => CUBE_CONF['panda']['s3_bucket'])
  puts "VideoEntryPandaWorker: fetched directories from #{CUBE_CONF['panda']['s3_bucket']}"

  # uploading the file
  puts "VideoEntryPandaWorker: creating fog file with src: #{video_entry.video_file.current_path}"
  file = fog_directory.files.new({
                                 :key    => video_entry.video_name,
                                 :body   => File.open(video_entry.video_file.current_path),
                                 :public => true
                             })
  file.save
  puts "VideoEntryPandaWorker: S3 url #{file.public_url}"

也许有人知道出了什么问题?

4

1 回答 1

1

我自己刚刚经历过这个,我正在运行 Fog1.11.1并升级1.15.0为我解决了这个问题。

于 2013-10-08T16:20:37.377 回答