# Path problem after deployment

**URL:** <https://discuss.rubyonrails.org/t/path-problem-after-deployment/9059>\
**Category:** rubyonrails-talk\
**Created:** [February 20, 2007, 10:57pm UTC](https://discuss.rubyonrails.org/t/path-problem-after-deployment/9059 "2007-02-20T22:57:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yi1](https://avatars.discourse-cdn.com/v4/letter/y/e56c9b/32.png) [@yi1](https://discuss.rubyonrails.org/u/yi1)\
**Post date:** [February 20, 2007, 10:57pm UTC](https://discuss.rubyonrails.org/t/path-problem-after-deployment/9059/1 "2007-02-20T22:57:08Z")

</div>

I have my first RoR app deployed on a hosting server using CGI: making a simlink in ~/public\_html to the "public" directory of my rails app.

Everything works fine except that the app can only read/write any file 'RAILS\_ROOT/public' directory. For example, on my development machine I use 'public/images/filename.jpg' to access image files, but on the hosting server I get errors like "unable to open image 'public/images/ filename.jpg': No such file or directory". The file actually exists but the app seems to be navigating the relative path from 'RAILS\_ROOT/ public' instead of RAILS\_ROOT. I can change the path string in my code so that the app can run correctly on the hosting server, but that way I won't be able to run it on my development computer.

This directoy access problem only happens in .rb files, for example uploading a picture and saving it to 'public/images'. In rthml files everyting is just fine.

Does this have anyting to do with the setting of RAILS\_ROOT?

Thanks Yi
