# Mod\_rails is defaulting to development mode

**URL:** <https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105>\
**Category:** Rails\
**Created:** [May 30, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105 "2008-05-30T20:40:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [May 30, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/1 "2008-05-30T20:40:17Z")

</div>

I just installed mod\_rails on a brand new Hardy server and for some  
reason it is defaulting to development mode. I even put RailsEnv in  
the apache config file.

Any ideas on what might be causing this?

---

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [May 30, 2008, 9:00pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/2 "2008-05-30T21:00:53Z")

</div>

Okay I disabled mod\_rails and noticed that the app is still defaulting  
to development mode (i did a rake db:create with no password on the  
development database to throw up and an error if it uses the  
development database) … so I guess it’s some rails thing or ruby  
thing that is going crazy … any ideas?

---

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [May 30, 2008, 9:56pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/3 "2008-05-30T21:56:46Z")

</div>

Did you try setting it in the config/environment.rb?

best.  
mike

---

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [May 30, 2008, 9:59pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/4 "2008-05-30T21:59:42Z")

</div>

Yea i can set it there but it only changes it for the web… when I do  
db:migration, it tries to use the development database

---

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [May 30, 2008, 10:09pm UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/5 "2008-05-30T22:09:42Z")

</div>

Okay thanks to help from [Slicehost.com](http://Slicehost.com) people, here is the code that i  
added to my .bashrc file:

export RAILS\_ENV=production

---

<div class="post-metadata">

**Author:** ![melvinram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Post date:** [June 1, 2008, 10:03am UTC](https://www.ruby-forum.com/t/mod-rails-is-defaulting-to-development-mode/139105/6 "2008-06-01T10:03:27Z")

</div>

Right, it has nothing to do with mod\_rails since you are doing rake. By  
default rake assumes development so you don’t end up shooting yourself  
in the foot.

To run with production use:

rake db:create RAILS\_ENV=production

Hth,  
Long

mel ram [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Okay I disabled mod\_rails and noticed that the app is still defaulting  
to development mode (i did a rake db:create with no password on the  
development database to throw up and an error if it uses the  
development database) … so I guess it’s some rails thing or ruby  
thing that is going crazy … any ideas?
