# How to change mode

**URL:** <https://www.ruby-forum.com/t/how-to-change-mode/135142>\
**Category:** Rails\
**Created:** [April 18, 2008, 11:49am UTC](https://www.ruby-forum.com/t/how-to-change-mode/135142 "2008-04-18T11:49:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 18, 2008, 11:49am UTC](https://www.ruby-forum.com/t/how-to-change-mode/135142/1 "2008-04-18T11:49:29Z")

</div>

hi all,

```
        i finished my ror application in development mode.now i want

```

to change the mode to “test” and “production”.how to do it.how to change  
my application to “test” and “production” modes.

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 18, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/how-to-change-mode/135142/2 "2008-04-18T12:50:43Z")

</div>

Change the envirument.rb file, to enable production mode. (remove the  
comment out of ENV production line)

Please note when running migrtation, you need to use:  
rake db:migrate RAILS\_ENV=“production” (for usage of the correct  
database)

regards  
svend

On Apr 18, 11:49 am, Karthikragunath B. \<rails-mailing-

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 19, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/how-to-change-mode/135142/3 "2008-04-19T14:47:57Z")

</div>

Karthikragunath B. wrote:

> ```
> i finished my ror application in development mode.now i want
> 
> ```
> 
> to change the mode to “test” and “production”.how to do it.how to change  
> my application to “test” and “production” modes.

You should have written unit tests for your app, as you developed it.  
‘rake  
test’ runs in test mode, and it depends on the test: key in your  
database.yml  
file, and your config/environments/test.rb file.

Run your server in development mode with one of these:

RAILS\_ENV=production script/server  
script/server -e production

–  
Phlip
