Permission Denied

104 views
Skip to first unread message

dave

unread,
Dec 3, 2008, 6:54:43 PM12/3/08
to Paperclip Plugin
Hi All,

I have just started using paperclip plugin, and when I try to save my
model I get a Permission Denied error on writing to the file share.

I have search the forum and it looks like other people have had the
same problem but there was no resolution to thes disucssions.
I am running under windows
Any help appreciated

conway98

unread,
Dec 5, 2008, 9:33:07 AM12/5/08
to Paperclip Plugin
I would like an answer to this problem as well. I am experiencing the
same thing on Windows XP SP3 running Ruby 1.8.7 with rails 2.2.2 and
the latest version of the Paperclip plugin. When I try to save a model
with a photo attached, I get an ActionController exception:

Errno::EACCES in ArrangementsController#create
Permission denied - C:/Temp/stream20081205-208-orsoji-0 or C:/Web/www/
flowershop/public/photos/1/original/P672_330x370.jpg

I have checked the permissions on both of these locations and made
sure that everyone has full access, but that doesn't seem to have any
effect. I know that linux-type OSes and Windows systems handle
permissions in different ways, but shouldn't Ruby handle that? I have
searched around the web and found some suggestions, even a patch
written by someone that was supposed to address the 0-byte file and
permissions problems, but nothing seems to help. If it makes any
difference, I am NOT running in cygwin. Anyone have any ideas? I'm
about out.

Jonathan Yurek

unread,
Dec 5, 2008, 9:44:19 AM12/5/08
to papercli...@googlegroups.com
Hi,

Thanks to the research of others, I've put in a patch that should
help. If you pull the latest version it should be fixed.
--
Jonathan Yurek, Founder and CTO
thoughtbot, inc.
organic brains. digital solutions.

617.482.1300 x114
http://www.thoughtbot.com/

conway98

unread,
Dec 5, 2008, 10:15:07 AM12/5/08
to Paperclip Plugin
Hi,

Thanks for such a quick response. I just applied your patch, but I'm
still getting the same error:

Errno::EACCES in ArrangementsController#create
Permission denied - C:/Temp/stream20081205-2516-yux537-0 or C:/Web/www/
flowershop/public/photos/1/original/P672_330x370.jpg

Any ideas?

Thanks.

conway98

unread,
Dec 5, 2008, 10:17:04 AM12/5/08
to Paperclip Plugin
I forgot to include in my previous reply that the directory 'railsapp/
public/photos/1/original' is being created, just not the file.

Thanks

dave

unread,
Dec 6, 2008, 6:46:01 PM12/6/08
to Paperclip Plugin
Hi, I tried the new version with the permissions change, still does
not work on Windows.

I have reverted the the version prior to the move version and all
works fine

dave

conway98

unread,
Dec 7, 2008, 10:46:32 AM12/7/08
to Paperclip Plugin
Could you clarify what you mean by "the version prior to the move
version"? Thanks.

Curt

inriz

unread,
Dec 7, 2008, 1:22:56 PM12/7/08
to Paperclip Plugin
Hello conway,

I had the same problem like you and after some changes
i've got a running version of paperclip on a win xp platform.

First of all, i ensure the obligatory special instructions for windows
on this site http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip

After that, i made some change in storage.rb#flush_writes.
It's a short workaround for
FileUtils.mv
Simply replace it with

FileUtils.cp(file.path, path(style))
FileUtils.rm(file.path)

Currently, it works for me. But please consider, it isn't checked
against a well written
test or any other platform.

I hope you can enjoy it.

Best regards

inriz

unread,
Dec 7, 2008, 1:23:06 PM12/7/08
to Paperclip Plugin
Hello conway,

I had the same problem like you and after some changes
i've got a running version of paperclip on a win xp platform.

First of all, i ensure the obligatory special instructions for windows
on this site http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip

After that, i made some change in storage.rb#flush_writes.
It's a short workaround for
FileUtils.mv
Simply replace it with

FileUtils.cp(file.path, path(style))
FileUtils.rm(file.path)

Currently, it works for me. But please consider, it isn't checked
against a well written
test or any other platform.

I hope you can enjoy it.

Best regards


On 7 Dez., 16:46, conway98 <curth...@gmail.com> wrote:

dave

unread,
Dec 8, 2008, 5:08:47 PM12/8/08
to Paperclip Plugin
Version 2.1.2 is the version prior to the Move change (2.1.3) which
works for me, (with the tempfile) changes in place, have not tested
it without the tmpfile stuff.

version 2.1.4 had the permission change done that still did not work
for me on windows

Dave
> > > > > 617.482.1300 x114http://www.thoughtbot.com/- Hide quoted text -
>
> - Show quoted text -

rob-twf

unread,
Dec 10, 2008, 5:36:53 AM12/10/08
to Paperclip Plugin
Hi,

The problem is caused by attempting to move a file which still has an
open file handle, I've just updated my 'windows love' patch to include
a fix for this:
http://thoughtbot.lighthouseapp.com/projects/8794-paperclip/tickets/58-broken-tests-and-reprocess-bug-on-windows#ticket-58-2

It also fixes reprocess! and broken tests on Windows - give it a try
and hopefully it'll work for you... and a +1 on the patch would be
nice if it does :)

Rob

--
Rob Anderton
http://www.thewebfellas.com/
> > > > > > 617.482.1300 x114http://www.thoughtbot.com/-Hide quoted text -
Reply all
Reply to author
Forward
0 new messages