Note that there are some explanatory texts on larger screens.

plurals
  1. POPaperclip ruby on rails s3 to_file method
    primarykey
    data
    text
    <p>I'm very confused here as to why paperclip isn't working for me.</p> <p>When accessing a previously saved file on s3 for processing this method of the paperclip s3 storage class causes an error:</p> <pre><code> def to_file style = default_style return @queued_for_write[style] if @queued_for_write[style] filename = path(style).split(".") extname = File.extname(filename) </code></pre> <p>What is happening is the path is being split into an array which then isn't accepted by File.extname which returns the error "can't convert Array into String". </p> <p>I'd really appreciate some advice on this; maybe my path is wrong but I cannot see how split is going to return anything but the array which causes an error on File.extname. This works fine in development but not on heroku where it worked previous to last weekend.</p> <p>Thank in advance.</p> <p>EDIT</p> <p>Have added a weighty bounty on this which reflects my ongoing frustration. Really if someone can help me troubleshoot this I'd be incredibly grateful. I've ruled out previous doubts I had, that maybe it was the heroku repository, by freshly installing the app again. </p> <p>All pertinent code as far as I can tell:</p> <pre><code>#photo.rb has_attached_file :photo, :styles =&gt; { :list =&gt; "150x100#", :article =&gt; "264&gt;x210", :large =&gt; "558&gt;x380", :original =&gt; "1024&gt;x768" }, :storage =&gt; :s3, :s3_credentials =&gt; "#{RAILS_ROOT}/config/s3.yml", :url =&gt; ":s3_alias_url", :s3_host_alias =&gt; "files.mydomain.com", #s3 bucket with dns cname record to subdomain :path =&gt; "/photos/:hashed_path/:style/:id.:extension" #config/s3.rb bucket: files.mydomain.com access_key_id: ******************* secret_access_key: ********************************** </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload