Index: server
===================================================================
--- server	(revision 460)
+++ server	(working copy)
@@ -6,7 +6,7 @@
 OPTIONS = {
   :port        => 2500,
   :ip          => "0.0.0.0",
-  :environment => "production",
+  :environment => ENV["RAILS_ENV"] || "development",
   :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"),
   :server_type => WEBrick::SimpleServer
 }
@@ -25,7 +25,7 @@
           "Default: 0.0.0.0") { |OPTIONS[:ip]| }
   opts.on("-e", "--environment=name", String,
           "Specifies the environment to run this server under (test/development/production).",
-          "Default: development") { |OPTIONS[:environment]| }
+          "Default: #{OPTIONS[:environment]}") { |OPTIONS[:environment]| }
   opts.on("-d", "--daemon",
           "Make Instiki run as a Daemon (only works if fork is available -- meaning on *nix)."
           ) { OPTIONS[:server_type] = WEBrick::Daemon }
@@ -38,7 +38,7 @@
   opts.parse!
 end
 
-ENV["RAILS_ENV"] = OPTIONS[:environment]
+ENV["RAILS_ENV"] ||= OPTIONS[:environment]
 require File.dirname(__FILE__) + "/../config/environment"
 require 'webrick_server'
 
