[Instiki] re-grouping, once again

Assaph Mehr assaph at gmail.com
Mon Jan 23 05:07:04 EST 2006


> I'd like to find a way to shoehorn this option into
> (my copy of) the instiki script, or put it into a
> setting somewhere

Normally you'd use the RAILS_ENV environment variable, but Instiki
doesn't use it properly. Here's a patch to fix:

--- server.orig 2006-01-23 20:54:09.921875000 +1100
+++ server      2006-01-23 20:55:06.453125000 +1100
@@ -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'

If you're on Windows, override the instiki.cmd as well (or delete and
run instiki.rb).

>   *  Is this (SVN HEAD) version using Rails 1.0?
>      (How would I tell?)

Look at the CHANGELOG, which says:
  Upgraded to Rails 0.14.3 (also know as 1.0 RC 4)
So I think it should work OK with 1.0. You can also look at
http://dev.instiki.org/timeline.

>   *  Does Rails have a problem with Ruby 1.8.4?
>      (Certainly, this code does!)

Not AFAIK. I know it had a problem with the (broken) 1.8.2 on OSX, but
I think 1.8.4 is the recommended party line.



More information about the Instiki-users mailing list