Why is webrick running in development mode?

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

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 :slight_smile:

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

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

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

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

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

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs