昨天它运作良好。现在我有这个错误。 我在本地运行我的网站。
Expected(200) <=> Actual(403 Forbidden) excon.error.response :body => "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access
Denied</Message><RequestId>C19FF4E3F2</RequestId><HostId>fUbWBNTH+qXOK0+QsFJzdARhvQ+KgRuwTZyklnq3v9WI/gt3I=</HostId></Error>"
:headers => { "Connection" => "close" "Content-Type" =>
"application/xml" "Date" => "Sat, 27 Feb 2016 08:06:19 GMT" "Server"
=> "AmazonS3" "x-amz-id-2" => "fUbWBNTH+nYXztwhtbwwWmsRzdARhvQ+KgRuwTZyklnt3I="
"x-amz-request-id" => "C19FF4E4E9A863F2" } :local_address =>
"192.168.1.5" :local_port => 60867 :reason_phrase => "Forbidden"
:remote_ip => "54.231.235.77" :status => 403 :status_line => "HTTP/1.1
403 Forbidden\r\n"
upd:我使用了carrierwave和fog,这是我的carrierwave配置:
CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => 'us-west-1', # Change this for different AWS region. Default is 'us-east-2'
:path_style => true
}
config.fog_directory = "bucket-main1"
config.fog_public = true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
end
当我将代码推送到服务器但不能在本地工作时,它也能正常工作