为什么 Paperclip 在生产 + 开发中默默失败? [英] Why is Paperclip failing silently in production + development?

查看:52
本文介绍了为什么 Paperclip 在生产 + 开发中默默失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是怎么回事,因为我在同一台服务器上有另一个应用程序可以很好地接收和保存上传.

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.

没有错误消息,Paperclip 甚至在日志中说它正在保存附件.

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

但是附件没有被保存.

有人想过吗?

另外,我将如何使用 RSpec/Capybara 对此进行测试,因为显然我的测试并未涵盖这一点.

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

运行 Paperclip 2.3.12、Rails 3.0.9、REE1.8.7

Running Paperclip 2.3.12, Rails 3.0.9, REE1.8.7

在 RHEL5/Apache 上生产,但在与我其他应用程序用户不同的用户上运行.

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.

推荐答案

我相信您忘记在表单中添加 multipart 选项

I believe you forget to add multipart option to your form

:html => {:multipart => true}

所以

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

这篇关于为什么 Paperclip 在生产 + 开发中默默失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆