# Authentic staging environment

**URL:** <https://www.ruby-forum.com/t/authentic-staging-environment/179997>\
**Category:** Deployment\
**Created:** [December 9, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/authentic-staging-environment/179997 "2009-12-09T14:14:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [December 9, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/authentic-staging-environment/179997/1 "2009-12-09T14:14:00Z")

</div>

I want to create an authentic staging environment where it will function  
precisely as it does in the production environment.

Given some plugins, e.g. asset packager, will behave differently if it’s  
not in ‘production’ environment, I figure it’s best to run the staging  
server in ‘production’ as well, rather than creating a new ‘staging’  
environment. Is this the correct way of doing this?

If so however, the staging server does need a slightly different  
configuration in order to communicate differently to the email server. I  
am having difficulty thinking of a way of doing this if they are both in  
‘production’ environment.

I thought perhaps I could set another variable in mod\_rails which can be  
picked up in Rails. Though having scanned the documentation nothing  
obvious sticks out.

Any advice is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [December 18, 2009, 5:43pm UTC](https://www.ruby-forum.com/t/authentic-staging-environment/179997/2 "2009-12-18T17:43:40Z")

</div>

A staging site is a very good idea: however you should have it on a  
different server with the same setup as your production server, since  
you’re inevitable going to be stopping and restarting it a lot and this  
will affect the performance of your live site (not to mention make it  
break completely when you restart nginx/apache/whatever) if they’re  
sitting on the same box. It should run in production as you say.

---

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [December 19, 2009, 4:30pm UTC](https://www.ruby-forum.com/t/authentic-staging-environment/179997/3 "2009-12-19T16:30:58Z")

</div>

Thanks for the reply. They are indeed on separate servers.

I ended using these environment names:  
development\_server - to differentiate from ‘development’ which is used  
locally  
staging  
production

I added ‘staging’ to merged\_environments for asset\_packager so that it  
merges asset files(js/css) on ‘staging’, using this:

Synthesis::AssetPackage.merge\_environments = [“staging”, “production”]
