Getting a broken pipe when downloading mp3 with a paper clip

Keep getting the broken pipe after downloading mp3 using paperclip on S3. What have I done wrong?

Model

  has_attached_file :mp3,
                :storage => :s3,
                :path => 'mp3/:class/:id/:style.:extension',
                :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
                :bucket => 'cobras-production',
                :url => ':s3_domain_url'

controller

 def create
  @track = Track.new(params[:track])
   if @track.save
    redirect_to(@track, :notice => 'Track was successfully created.')
   else
    render :action => "new"
   end
 end
+3
source share
4 answers

I think there might be a problem with the location without our place.

I have 2 applications configured to run on heroku, and I ran into a problem that you mention. When I changed the location of my bucket in the USA, the paperclip folder worked perfectly with the same file.

If you are using Singapore or Tokyo as your bucket trap.

https://github.com/marcel/aws-s3/issues/#issue/4

this explains the problem better

+2

, , - . aws-s3, -

AWS::S3::Bucket.create("cobras-production")
+1

, ( ) AWS "".
, .

+1

: , , . Amazon , .

0

Source: https://habr.com/ru/post/1779610/


All Articles