# Attachment\_fu and rails 2.3.2 no image on disk

**URL:** <https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908>\
**Category:** Rails\
**Created:** [May 27, 2009, 10:09am UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908 "2009-05-27T10:09:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 27, 2009, 10:09am UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/1 "2009-05-27T10:09:17Z")

</div>

Hi,

After upgrade to Rails 2.3.2 I have a problem with attachments.

After uploading the attachment in the images table there is a new  
record. But the file does not exist on the file system.

has\_attachment :content\_type =\> :image,  
:storage =\> :file\_system,  
:size =\> 0.megabyte…2.megabytes,  
:thumbnails =\> { :thumb =\> ‘150x150\>’,  
:thumb72 =\> ‘72x72\>’,  
:thumb90 =\> ‘90x90\>’,  
:thumb150fixed =\> ‘150x’,  
:thumb120 =\> ‘120x120\>’,  
:thumb300 =\> ‘300x300\>’,  
:thumb400 =\> ‘400x400\>’,  
:thumb500 =\> ‘500x500\>’  
},  
:processor =\> MiniMagick

Any help appreciated.

Michal.

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 27, 2009, 11:18am UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/2 "2009-05-27T11:18:15Z")

</div>

The error could be so many things, these details that you gived are  
not sufficient…

Did you check your log files for any possible error?  
Are you sure that MiniMagick is working well?  
The new version of rails is installed correctly?  
Did you tryed to upload different kinds of files?

Give a little more details please

On 27 mayo, 02:09, Michal B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 27, 2009, 1:34pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/3 "2009-05-27T13:34:14Z")

</div>

Julian L. wrote:

> His problem is most likely a permissions issue.

Did the “permission policy” between rails 2.1 and 2.3 change?

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 27, 2009, 2:19pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/4 "2009-05-27T14:19:45Z")

</div>

On 27/05/2009, at 9:34 PM, Michal B. wrote:

> Julian L. wrote:
> 
> > His problem is most likely a permissions issue.
> 
> Did the “permission policy” between rails 2.1 and 2.3 change?

LOL what’s the permission policy?

Whichever user is running the app needs write access if you want to  
write files, unless I’m seriously mistaken.

Julian.

* * *

Learn: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)  
Last updated 20-May-09 (Rails, Basic Unix)  
Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Twitter: [http://twitter.com/random8r](http://twitter.com/random8r)

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 28, 2009, 10:26am UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/5 "2009-05-28T10:26:32Z")

</div>

The problem is probably something similar to  
[http://blog.methodmissing.com/2008/1/19/edge-callback-refactorings-attachment\_fu/](http://blog.methodmissing.com/2008/1/19/edge-callback-refactorings-attachment_fu/)

In my case the method process\_attachment defined as a after\_validation  
callback doesn’t get called for the second attachment of my model.

I replaced beginning of the method:

def after\_process\_attachment  
if save\_attachment?  
(…)

I don’t know what will it cause other than making my attchements work.  
But they do work now, and I’m glad.

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 28, 2009, 10:32am UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/6 "2009-05-28T10:32:08Z")

</div>

> LOL what’s the permission policy?
> 
> Whichever user is running the app needs write access if you want to  
> write files, unless I’m seriously mistaken.
> 
> Julian.

Whatever, I don’t know what could it mean. I’m not that familiar with  
rails unfortunately.

The problem is that after migration the attachments stopped working. So  
if we discuss permissions to file system the first thing that comes to  
my mind is - did the permission policy changed.

The definition of the term “permission policy” I used is from Java  
environment, cos I’m used to it. For e.g.  
[http://java.sun.com/j2se/1.4.2/docs/guide/security/permissions.html](http://java.sun.com/j2se/1.4.2/docs/guide/security/permissions.html). I  
could not find any more suitable.

---

<div class="post-metadata">

**Author:** ![benol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bb73d2/32.png) [@benol](https://www.ruby-forum.com/u/benol)\
**Post date:** [May 27, 2009, 12:09pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-rails-2-3-2-no-image-on-disk/168908/7 "2009-05-27T12:09:58Z")

</div>

His problem is most likely a permissions issue.

* * *

Learn: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)  
Last updated 20-May-09 (Rails, Basic Unix)  
Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Twitter: [http://twitter.com/random8r](http://twitter.com/random8r)
