Ruby - Permission Denied in Delete or Rename

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Ruby - Permission Denied in Delete or Rename

Post by Jonah Bron »

Hello, world!

I'm thoroughly stumped. :(

I have Ruby installed on my dad's computer, and cannot use it to rename or delete files. All other features work well. It only says "Permission Denied".

Any thoughts?

Thanks!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Ruby - Permission Denied in Delete or Rename

Post by Benjamin »

What operating system are you using?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Ruby - Permission Denied in Delete or Rename

Post by Jonah Bron »

Windows XP. Just discovered that I had it open earlier in the script, and forgot to close it. But, now I am trying to delete a folder, and it is giving me the same problem. It was made with FileUtils.mkdir_p, and then a file was put into it with File.move. I don't think that either of those require you to close the file.

Thanks
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Ruby - Permission Denied in Delete or Rename

Post by Benjamin »

What is the error message?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Ruby - Permission Denied in Delete or Rename

Post by Jonah Bron »

c:/Program Files/ruby/lib/ruby/1.8/tk.rb:1354:in `callback': Errno::EACCES: Permission denied - C:\Documents and Settings\User\My Documents\New Folder (Errno::EACCES)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Ruby - Permission Denied in Delete or Rename

Post by Benjamin »

Interesting. See if this helps, there seems to be numerous solutions and variants of this issue:

http://www.google.com/search?hl=en&clie ... tnG=Search
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Ruby - Permission Denied in Delete or Rename

Post by Jonah Bron »

Whoa! This post is the fourth result. 8O
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Ruby - Permission Denied in Delete or Rename

Post by Jonah Bron »

Uh-duh! I was trying to use the File class to delete a directory, instead of the Dir class. :crazy:

Thanks!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Ruby - Permission Denied in Delete or Rename

Post by Benjamin »

Jonah Bron wrote:Whoa! This post is the fourth result. 8O
Yeah, google is getting pretty quick!
Post Reply