# Switching to production environment

**URL:** <https://www.ruby-forum.com/t/switching-to-production-environment/71486>\
**Category:** Rails\
**Created:** [February 21, 2006, 7:28pm UTC](https://www.ruby-forum.com/t/switching-to-production-environment/71486 "2006-02-21T19:28:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Czarny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7cd45c/32.png) [@Eric\_Czarny](https://www.ruby-forum.com/u/Eric_Czarny)\
**Post date:** [February 21, 2006, 7:28pm UTC](https://www.ruby-forum.com/t/switching-to-production-environment/71486/1 "2006-02-21T19:28:08Z")

</div>

Hey All,

I can’t seem to find a straight answer, but I was wondering if  
someone could provide me with a simple explanation of switching to  
the production environment. It looks like I could just alter  
environments.rb under /config, but that seems like a hack. How would  
I go about getting my application running in the production environment?

Cheers,  
Eric Czarny

removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Eric\_Czarny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7cd45c/32.png) [@Eric\_Czarny](https://www.ruby-forum.com/u/Eric_Czarny)\
**Post date:** [February 21, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/switching-to-production-environment/71486/2 "2006-02-21T19:34:16Z")

</div>

On Feb 21, 2006, at 10:25 AM, Eric Czarny wrote:

> I can’t seem to find a straight answer, but I was wondering if  
> someone could provide me with a simple explanation of switching to  
> the production environment. It looks like I could just alter  
> environments.rb under /config, but that seems like a hack. How  
> would I go about getting my application running in the production  
> environment?

Uncomment this line in environment.rb:

# ENV[‘RAILS\_ENV’] ||= ‘production’

Then, you can set the RAILS\_ENV environment variable  
before starting the application.

–  
– Tom M.

---

<div class="post-metadata">

**Author:** ![Eric\_Czarny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7cd45c/32.png) [@Eric\_Czarny](https://www.ruby-forum.com/u/Eric_Czarny)\
**Post date:** [February 21, 2006, 9:36pm UTC](https://www.ruby-forum.com/t/switching-to-production-environment/71486/3 "2006-02-21T21:36:12Z")

</div>

As is mentioned in the very environment.rb, set it in your app/web  
server. SCGI has an environment setting in its YAML config. WEBrick has  
a command line option (not that you’d want to really use it for full-on  
production).

Joe
