# Deploying Rails

**URL:** <https://www.ruby-forum.com/t/deploying-rails/125697>\
**Category:** Rails\
**Created:** [January 11, 2008, 7:57am UTC](https://www.ruby-forum.com/t/deploying-rails/125697 "2008-01-11T07:57:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 11, 2008, 7:57am UTC](https://www.ruby-forum.com/t/deploying-rails/125697/1 "2008-01-11T07:57:50Z")

</div>

Hello all,

```
I am new to ruby on rails. I started to deploy a open source

```

project into my website under a subdomain called ‘scheduler’. But when  
I point to [www.mydomain.com/scheduler/](http://www.mydomain.com/scheduler/) I am getting my home page when  
i login through my home page I am getting page not found.

This is due to when I hit login button the /controller/action is being  
pointed from the main domain i.e

[www.mydomain.com/controller/action](http://www.mydomain.com/controller/action)

instead of being [www.mydomain.com/scheduler/controller/action](http://www.mydomain.com/scheduler/controller/action)

Can anyone advise me how to change the domain in the links. Also all  
the images in the page are mislinked as there are referencing from the  
[mydomain.com](http://mydomain.com) instead of scheduler.

I deployed the app by copying the models, controllers, helpers, views  
and the neccesary files.

Thanks for the support.

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 11, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/deploying-rails/125697/2 "2008-01-11T18:23:34Z")

</div>

From the paths you give, your using a subdirectory, not a subdomain. A  
subdomain would be [scheduler.mydomain.com](http://scheduler.mydomain.com) and would have to be set up  
in your DNS. It is is a separate app from the rest of the site, that  
is a good way to go.

If you want to continue using a subdirectory, I think you’ll need to  
either edit routes.rb so the paths include “/scheduler”. Or I think  
you could set the value of the RAILS\_ROOT constant.

Michael S.  
[www.BuildingWebApps.com](http://www.BuildingWebApps.com)  
[www.LearningRails.com](http://www.LearningRails.com)

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 11, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/deploying-rails/125697/3 "2008-01-11T18:47:07Z")

</div>

Hi Michael,

Thanks a lot for the reply… yes I have created a sub directory not a  
subdomain (sorry for that). Can you tell me how to edit the routes.rb  
to include the path (/scheduler)…or having a RAILS\_ROOT constant…

Once again I appreciate your help.

thank you

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 11, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/deploying-rails/125697/4 "2008-01-11T22:29:25Z")

</div>

Hey Brian,

```
    Thanks a lot for the adive. I would certainly deploy my app

```

using the sub domain. Anyway thanks for the plugin. I will try it when  
I am on IIS.  
Do you have any open source projects (APPS) designed using rails. I  
want to look at the source code and learn Rails in much more  
practical approach… Thanks once again.

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 11, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/deploying-rails/125697/5 "2008-01-11T20:48:27Z")

</div>

Save yourself a lot of trouble and just deploy to a subdomain. This is  
one  
of those opinions that Rails has that can really bite you in the butt.

If you just simply can’t, I do have a plugin that will prepend all  
internally generated URLs (link\_to, url\_for, stylesheet\_link\_tag,  
javascript\_link\_tag, image\_tag) stuff for you. It’s designed mainly for  
reverse proxying to Rails apps behind IIS, but it could work for you.  
i’d  
actually be interested to know if it does.

See this post:  
[http://www.napcsweb.com/blog/2007/12/18/reverse\_proxy\_fix-1041-released-with-rails-20-support/](http://www.napcsweb.com/blog/2007/12/18/reverse_proxy_fix-1041-released-with-rails-20-support/)
