# Creating a custom environment

**URL:** <https://www.ruby-forum.com/t/creating-a-custom-environment/136963>\
**Category:** Rails\
**Created:** [May 7, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/creating-a-custom-environment/136963 "2008-05-07T18:58:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@dr\_j](https://www.ruby-forum.com/u/dr_j)\
**Post date:** [May 7, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/creating-a-custom-environment/136963/1 "2008-05-07T18:58:57Z")

</div>

First, I do consider myself still a noob with Ruby/Rails (Rails 2.0).

My question has to do with creating a custom environment; rails  
provides the development/test/production environments, but the shop  
I’m working at has the standard of naming environments based on the  
deployment box. From the little I’ve been able to find on the subject,  
creating a custom environment can be as little as copying the nearest  
environment file that is like what you want. So, I merrily copied the  
test environment to “host1.rb”, and the production file to  
“host2.rb”. I then have the startup scripts for our app set the  
RAILS\_ENV appropriately.

This gets me half-way there. The correct environment files are loaded,  
and everything runs, but … apparently a number of settings depend  
upon the default environment naming. For example, logging within the  
application is still set to the default for development; micro-  
benchmarking of rendered items is still turned on … etc. Despite  
having the environment file essentially identical to production.rb  
(okay, it really is identical), a number of config settings for  
production.rb are not picked up when host2.rb is used.

What do I need to do in order to create my own environment that really  
does act like the default Rails production environment? Will I have to  
dig up all the various config settings and set them manually within my  
environment file?

Thanks!

john
