# Why is webrick running in development mode?

**URL:** <https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497>\
**Category:** Rails\
**Created:** [July 29, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497 "2006-07-29T14:34:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 29, 2006, 2:34pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/1 "2006-07-29T14:34:46Z")

</div>

Hi,

I changed my environmnet.rb to say PRODUCTION mode, however when I start  
up a server “ruby scripts/server”

a) it runs in development mode (via the logs) - any ideas why?

b) why does webbrick run - I thought by default now it was supposed to  
be lightty

Tks

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 29, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/2 "2006-07-29T15:37:07Z")

</div>

Oh… I guess I’m trying to understand why on my hosting environment  
(dreamhost) it seems to run in PRODUCTION mode (dreamhost using Apache &  
FastCGI), but on my local PC (with the same environment.rb file) it runs  
in DEVELOPMENT mode. Perhaps the script/server scripts themself  
override the environment.rb setting?

BTW - The behaviour I’m after is pretty much as things are occuring now,  
I just don’t quite understand why things are occuring like they are 🙂

Greg

jh100000 wrote:

> Greg H. wrote:
> 
> > Hi,
> > 
> > I changed my environmnet.rb to say PRODUCTION mode, however when I start  
> > up a server “ruby scripts/server”
> > 
> > a) it runs in development mode (via the logs) - any ideas why?
> > 
> > b) why does webbrick run - I thought by default now it was supposed to  
> > be lightty
> > 
> > Tks
> 
> To get webby to run in production mode I think you need to do
> 
> script/server -e production or
> 
> script/server --environment=production
> 
> –John

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 29, 2006, 2:48pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/3 "2006-07-29T14:48:57Z")

</div>

Greg H. wrote:

> Hi,
> 
> I changed my environmnet.rb to say PRODUCTION mode, however when I start  
> up a server “ruby scripts/server”
> 
> a) it runs in development mode (via the logs) - any ideas why?
> 
> b) why does webbrick run - I thought by default now it was supposed to  
> be lightty
> 
> Tks

To get webby to run in production mode I think you need to do

script/server -e production or

script/server --environment=production

–John

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 30, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/4 "2006-07-30T23:57:43Z")

</div>

a) Do you mean you uncommented the following line?  
# ENV[‘RAILS\_ENV’] ||= ‘production’  
b) Is lighttpd in your PATH? Try ‘which lighttpd’ to check.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 31, 2006, 12:32am UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/5 "2006-07-31T00:32:28Z")

</div>

Rails will not use lighttpd if the libfcgi-ruby is not installed.  
That’s tripped me up a couple of times.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 29, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/6 "2006-07-29T15:46:12Z")

</div>

Greg,

If you’ve got Agile Web Dev with Rails, goto pg 463 where it explains  
how to set the environment for each webserver. Using -e production only  
works for webrick. Apache uses the RAILS\_ENV.

hth,

–John

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 31, 2006, 11:36am UTC](https://www.ruby-forum.com/t/why-is-webrick-running-in-development-mode/100497/7 "2006-07-31T11:36:38Z")

</div>

I used InstantRails to get Ruby/Rails onto my PC so perhaps lighttpd is  
not part of the package, so I guess this is why its defaulting to  
webbrick.

Is it worth installing any making the move from webbrick to lighty just  
for a development environment on my PC? (i.e. I’m using dreamhost for  
hosting, so this is Apache/FastCGI I believe - I guess the best would be  
to match production and run Apache/FastCGI on my PC???)

Tks

Steve B. wrote:

> Rails will not use lighttpd if the libfcgi-ruby is not installed.  
> That’s tripped me up a couple of times.

Derek C. wrote:

> a) Do you mean you uncommented the following line?  
> # ENV[‘RAILS\_ENV’] ||= ‘production’  
> b) Is lighttpd in your PATH? Try ‘which lighttpd’ to check.
