Forum: Ruby on Rails attachment_fu and rails 2.3.2 no image on disk

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2f4da0b00002db5629dcaade6a8cdfc2?d=identicon&s=25 Michal Burak (michalb82)
on 2009-05-27 10:09
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.
482517e3e7f1be3c858dbdb4b8f288a1?d=identicon&s=25 fRAnKEnSTEin (Guest)
on 2009-05-27 11:18
(Received via mailing list)
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 Burak <rails-mailing-l...@andreas-s.net>
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-05-27 12:09
(Received via mailing list)
His problem is most likely a permissions issue.

----------------------------------------------
Learn: http://sensei.zenunit.com/
Last updated 20-May-09 (Rails, Basic Unix)
Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
2f4da0b00002db5629dcaade6a8cdfc2?d=identicon&s=25 Michal Burak (michalb82)
on 2009-05-27 13:34
Julian Leviston wrote:
> His problem is most likely a permissions issue.
>

Did the "permission policy" between rails 2.1 and 2.3 change?
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-05-27 14:19
(Received via mailing list)
On 27/05/2009, at 9:34 PM, Michal Burak wrote:

>
> Julian Leviston 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/
Last updated 20-May-09 (Rails, Basic Unix)
Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
2f4da0b00002db5629dcaade6a8cdfc2?d=identicon&s=25 Michal Burak (michalb82)
on 2009-05-28 10:26
The problem is probably something similar to
http://blog.methodmissing.com/2008/1/19/edge-callb...

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.
2f4da0b00002db5629dcaade6a8cdfc2?d=identicon&s=25 Michal Burak (michalb82)
on 2009-05-28 10:32
>
> 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.... I
could not find any more suitable.
This topic is locked and can not be replied to.