Forum: Ruby on Rails development and production running simultaneously?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D855690573f11a2eba3951203c603b7e?d=identicon&s=25 Sergio Bayona (Guest)
on 2006-05-10 08:07
(Received via mailing list)
I'd like to be able to run both development and production as follows:

www.mysite.com will be running production
dev.mysite.com will be running development

It should run the same code base. The server is RedHat Enterprise 3,
Apache, FastCgi.

My problem is I don't know where to set the environment so the
application bootstraps depending on the virtual host (www/dev).

I'd really appreciate if someone can point me in the right direction.

Thanks,
Serge
Cfda8d3a956b6bf4b73f8fc2132da051?d=identicon&s=25 Kenneth Liu (Guest)
on 2006-05-10 17:11
(Received via mailing list)
This seems like a bad idea to me.  Isn't the development code always
going to have a newer code base than production?  Ideally you want to
keep your development and production environments totally separate in
order to avoid accidentally putting development level code into
production.

It's easy enough to maintain two separate sets of the config files, one
for development and one for production, and use the correct ones for the
environment you're deploying to.

Ken
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-05-10 18:46
(Received via mailing list)
I don't understand how you can run production and development
simultanously.
Are you developing at a datacenter right in front of your production box
?
Or are you hosting at your office and have a big pipe coming in ?
Fb23bc8cd4030c526b0689276b34c8bd?d=identicon&s=25 Bryan Duxbury (bryanduxbury)
on 2006-05-10 18:53
> My problem is I don't know where to set the environment so the
> application bootstraps depending on the virtual host (www/dev).

This is definitely the hard way to make it work. Check out another copy
of your app into another folder (like .../mysite/dev) and set up a
virtual host in Apache. If for some reason you really want to use the
same code in two places, you could check out the common parts into one
directory, then make symlinks to those directories in "fake" rails
folders, having individual config files.
This topic is locked and can not be replied to.