# How do I set my database to production?

**URL:** <https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791>\
**Category:** Rails\
**Created:** [June 14, 2007, 4:24am UTC](https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791 "2007-06-14T04:24:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 14, 2007, 4:24am UTC](https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791/1 "2007-06-14T04:24:17Z")

</div>

I know how to set the paswords and database names in database.yml,  
but I haven’t found in my book  
where do I set rails to use the production database ? What will be  
different once I do that ?  
Is prod more secure and there is less logging ? It allways uses the  
dev database at the moment.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 14, 2007, 5:29am UTC](https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791/2 "2007-06-14T05:29:21Z")

</div>

When you start your server use a -e production i.e.

ruby script/server -e production

Cam

On Jun 14, 12:23 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 14, 2007, 11:24am UTC](https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791/3 "2007-06-14T11:24:57Z")

</div>

Hi, you’ll need to do the following:

1. uncomment the following in \<path\_to\_rails\_app\>/config/environment.rb

2. set the required fields in your  
\<path\_to\_rails\_app\>/config/database.yml

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 14, 2007, 11:14am UTC](https://www.ruby-forum.com/t/how-do-i-set-my-database-to-production/106791/4 "2007-06-14T11:14:55Z")

</div>

I have a site [hostingrails.com](http://hostingrails.com), I never start the server there. I’m  
not sure how I would do it and I don’t recall seeing it in their docs.  
I figured I must have read something on this and forgotten it, but the  
method you mention I don’t ever recall reading and I have a whole  
bunch of books …
