简体   繁体   中英

Why is Paperclip failing silently in production + development?

I'm clueless as to what's going on with this because I have another app on the same server that receives and saves uploads just fine.

No error messages, Paperclip even say's in the log it's saving the attachments.

But the attachments don't get saved.

Thoughts anyone?

Also how would I test for this using RSpec/Capybara, because apparently my tests don't cover this.

Running Paperclip 2.3.12, Rails 3.0.9, REE1.8.7

Production on RHEL5 / Apache, but runs on a different user than my other app's user.

Update I get the same silent fail on development too!

But my test's pass and I can see the image being uploaded with the tests.

I believe you forget to add multipart option to your form

:html => {:multipart => true}

so

<%= form_for @my_object, :html => {:multipart => true} do |f| -%>
  ...
<% end %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM