Why is Paperclip failing silently in production + development?

久未见 提交于 2020-01-06 04:51:12

问题


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.


回答1:


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 %>


来源:https://stackoverflow.com/questions/6681536/why-is-paperclip-failing-silently-in-production-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!