# Moving Files on the Server?

**URL:** <https://www.ruby-forum.com/t/moving-files-on-the-server/122721>\
**Category:** Rails\
**Created:** [December 11, 2007, 9:54am UTC](https://www.ruby-forum.com/t/moving-files-on-the-server/122721 "2007-12-11T09:54:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [December 11, 2007, 9:54am UTC](https://www.ruby-forum.com/t/moving-files-on-the-server/122721/1 "2007-12-11T09:54:20Z")

</div>

Hi-

Say I wanted to move a file from /public/images to /someotherfolder.

How would I do this with Rails?

Thanks.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [December 12, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/moving-files-on-the-server/122721/2 "2007-12-12T18:25:59Z")

</div>

Is this a difficult problem? Why can I not do:

FileUtils.cp('file1, ‘file2’)? - Even thought the files exist, it  
tells me that they do not.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [December 12, 2007, 7:15pm UTC](https://www.ruby-forum.com/t/moving-files-on-the-server/122721/3 "2007-12-12T19:15:14Z")

</div>

Because you’re trying to access them in relation to the file that you’re  
running it from. If you’re thinking that they’re in public, try  
“#{RAILS\_ROOT}/public/file1”.

On Dec 11, 2007 11:59 PM, pete [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > How would I do this with Rails?
> > 
> > Thanks.

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!
