# Moving to production

**URL:** <https://www.ruby-forum.com/t/moving-to-production/91880>\
**Category:** Rails\
**Created:** [April 13, 2007, 1:59am UTC](https://www.ruby-forum.com/t/moving-to-production/91880 "2007-04-13T01:59:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skrinak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Skrinak](https://www.ruby-forum.com/u/Skrinak)\
**Post date:** [April 13, 2007, 1:59am UTC](https://www.ruby-forum.com/t/moving-to-production/91880/1 "2007-04-13T01:59:28Z")

</div>

How do you configure apache on red hat linux ‘the proper way’ for  
production? There’s an intriguing line in config/envinronment.rb:

# Uncomment below to force Rails into production mode when

# you don’t control web/app server and can’t set it the proper way

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

I’ve spent most of the day looking for this ‘proper way’. Can any  
guide me to this mysterious place?

---

<div class="post-metadata">

**Author:** ![Skrinak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Skrinak](https://www.ruby-forum.com/u/Skrinak)\
**Post date:** [April 13, 2007, 2:21am UTC](https://www.ruby-forum.com/t/moving-to-production/91880/2 "2007-04-13T02:21:13Z")

</div>

I believe it is necessary to modify the config/envinronment.rb file by  
uncommenting “ENV[‘RAILS\_ENV’] ||= ‘production’” line, unless you use  
Webrick. Then you can specify the environment by typing “ruby/script  
server -e production”.

---

<div class="post-metadata">

**Author:** ![Skrinak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Skrinak](https://www.ruby-forum.com/u/Skrinak)\
**Post date:** [April 18, 2007, 5:11am UTC](https://www.ruby-forum.com/t/moving-to-production/91880/3 "2007-04-18T05:11:57Z")

</div>

Thank you!

BTW, where did you find that documented?

Kris

---

<div class="post-metadata">

**Author:** ![Skrinak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Skrinak](https://www.ruby-forum.com/u/Skrinak)\
**Post date:** [April 18, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/moving-to-production/91880/4 "2007-04-18T15:01:45Z")

</div>

To do the migration, you don’t need to edit the environment files at  
all. Otherwise you’ll be editing those on both your dev & prod  
environments with every deploy (which is a BadThing®). Instead, you  
can run your migration on the production database by calling rake  
db:migrate RAILS\_ENV=production. For quick testing you can even use  
script/console production.

When you start your server you pass it the environment flag (works  
for webbrick, mongrel, etc)

Cheers,

Niels
