# Create and run multiple rails apps from within a rails app

**URL:** <https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991>\
**Category:** Rails\
**Created:** [April 6, 2008, 6:58am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991 "2008-04-06T06:58:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DyingToLearn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Post date:** [April 6, 2008, 6:58am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991/1 "2008-04-06T06:58:34Z")

</div>

Hi,

I am hoping to build a rails app that can create other rails apps and  
run them. Basically the user fills in some parameters and a new rails  
app is generated. Once generated, then the new application is running.

I have no problem putting together the code that generates the new  
app. However, I am having trouble with figuring out how to run the new  
applications. I see two main options:

1. Reconfigure my web server to support the new app. This is not my  
preference because I would not like to change my code to support  
different hosting environments (development/production).

2. Having my main rails app accept all the requests, then send them on  
to the new app. I really don’t know how this would work. Is it  
possible? Is it reasonable?

All of the apps will be low-traffic.

Thanks!

---

<div class="post-metadata">

**Author:** ![DyingToLearn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Post date:** [April 6, 2008, 8:27am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991/2 "2008-04-06T08:27:24Z")

</div>

If it low traffic why not install it on subdomain on the same host?

[Http://www.rubyplus.org](Http://www.rubyplus.org)  
Free Ruby & Rails screencasts

---

<div class="post-metadata">

**Author:** ![DyingToLearn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Post date:** [April 6, 2008, 8:53am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991/3 "2008-04-06T08:53:42Z")

</div>

Thanks for the reply!

I am hoping to use the same host. However, I want the entire  
application to be set up programmatically. I know I could just  
reconfigure the webserver, but I would really like to keep my  
implementation webserver agnostic (if possible).

As for subdomains, they would certainly look very nice. However, I  
don’t know if this will be possible without making my implementation  
webserver-specific. Please let me know if I am wrong!

Cheers

---

<div class="post-metadata">

**Author:** ![DyingToLearn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Post date:** [April 6, 2008, 9:01am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991/4 "2008-04-06T09:01:53Z")

</div>

Check out adv rails recipes. It shows how to use subdomains in rails  
apps.

[Http://www.rubyplus.org](Http://www.rubyplus.org)  
Free Ruby & Rails screencasts

---

<div class="post-metadata">

**Author:** ![DyingToLearn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Post date:** [April 6, 2008, 9:22am UTC](https://www.ruby-forum.com/t/create-and-run-multiple-rails-apps-from-within-a-rails-app/133991/5 "2008-04-06T09:22:55Z")

</div>

Advanced Rails Recipes has been on my wish list since Christmas, but  
Amazon isn’t shipping it to Canada yet ☹

I did check out this page  
[http://wiki.rubyonrails.org/rails/pages/HowToUseSubdomainsAsAccountKeys](http://wiki.rubyonrails.org/rails/pages/HowToUseSubdomainsAsAccountKeys)

That was kind of useful, but it doesn’t really address the whole  
issue. I need these to be completely separate rails apps. Each one  
gets its own database, etc.

Thanks!
