使用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}"
也许有人知道出了什么问题?
答案 0 :(得分:1)
我自己经历过这个,我正在运行Fog 1.11.1
并升级到1.15.0
为我解决了这个问题。