# Attachment\_fu & update\_attributes... bug?

**URL:** <https://www.ruby-forum.com/t/attachment-fu-update-attributes-bug/90365>\
**Category:** Rails\
**Created:** [March 28, 2007, 5:10am UTC](https://www.ruby-forum.com/t/attachment-fu-update-attributes-bug/90365 "2007-03-28T05:10:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![osteo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a87d85/32.png) [@osteo](https://www.ruby-forum.com/u/osteo)\
**Post date:** [March 28, 2007, 5:10am UTC](https://www.ruby-forum.com/t/attachment-fu-update-attributes-bug/90365/1 "2007-03-28T05:10:00Z")

</div>

It seems that attachment\_fu is a pretty popular plugin (it’s great), but  
I’ve been having a terrible time trying to figure out an issue when  
using “update\_attributes”. I’m storing files on the file system rather  
than in a database.

It seems that when “update\_attributes” is called with a new file,  
upload\_data= tries to copy a file that doesn’t exist, the file name of  
the new upload\_data.

Anyway here’s the error I get:

No such file or directory -public/db\_files/songs/4/Song.mp3

/usr/lib/ruby/1.8/fileutils.rb:1182:in `stat' /usr/lib/ruby/1.8/fileutils.rb:1182:in `lstat’  
/usr/lib/ruby/1.8/fileutils.rb:1160:in `stat' /usr/lib/ruby/1.8/fileutils.rb:1242:in `copy\_file’  
/usr/lib/ruby/1.8/fileutils.rb:459:in `copy_file' /usr/lib/ruby/1.8/fileutils.rb:383:in `cp’  
/usr/lib/ruby/1.8/fileutils.rb:1377:in `fu_each_src_dest' /usr/lib/ruby/1.8/fileutils.rb:1393:in `fu\_each\_src\_dest0’  
/usr/lib/ruby/1.8/fileutils.rb:1375:in `fu_each_src_dest' /usr/lib/ruby/1.8/fileutils.rb:382:in `cp’  
vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:154:in  
`copy_to_temp_file' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/object/misc.rb:23:in `returning’  
vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:152:in  
`copy_to_temp_file' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:288:in `copy\_to\_temp\_file’  
vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:265:in  
`temp_paths' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:272:in `temp\_path=’  
vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:250:in  
`uploaded_data=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in `attributes=’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1671:in  
`attributes=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1591:in `update\_attributes’  
app/controllers/songs\_controller.rb:44:in `update’  
-e:4

I found some other people reporting these issues, (  
[Parked at Loopia](http://beast.caboo.se/forums/2/topics/895) &  
[Parked at Loopia](http://beast.caboo.se/forums/2/topics/899) ). Does anyone have  
experience with this problem or have any good work arounds? Thanks.

---

<div class="post-metadata">

**Author:** ![osteo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a87d85/32.png) [@osteo](https://www.ruby-forum.com/u/osteo)\
**Post date:** [March 28, 2007, 6:21am UTC](https://www.ruby-forum.com/t/attachment-fu-update-attributes-bug/90365/2 "2007-03-28T06:21:58Z")

</div>

On 3/27/07, Mitch M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anyway here’s the error I get:  
> /usr/lib/ruby/1.8/fileutils.rb:1393:in `fu_each_src_dest0' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:265:in `update\_attributes’  
> app/controllers/songs\_controller.rb:44:in `update’  
> -e:4
> 
> I found some other people reporting these issues, (  
> [Parked at Loopia](http://beast.caboo.se/forums/2/topics/895) &  
> [Parked at Loopia](http://beast.caboo.se/forums/2/topics/899) ). Does anyone have  
> experience with this problem or have any good work arounds? Thanks.

If someone can write a failing test for this I can look at it. I  
haven’t been seeing the issue in the projects I’ve been using it in.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
