From: "Mauricio Fernández" Date: 2004-08-14T01:42:04+09:00 Subject: Re: Problem with Instiki and Windows --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 14, 2004 at 12:16:09AM +0900, Daniel Berger wrote: > Hi all, > > Ruby 1.8.2-7a > Instiki 0.9.1 > Windows XP Pro > > I tried running Instiki on my Windows XP box. It seemed to start > fine, but as soon as I try to fire up a web browser and view > "http://localhost:2500", I get a bunch of spewage: This is a known bug in instiki 0.9.1: it fails to create the storage repository. There was some other common bug IIRC (not sure) but I can't remember which one it was :-P Please find attached an extract of the patch I applied for the RPA package; maybe you can adapt it (there's a couple RPA specific things there, but should be easy to spot). You might also want to try to rpa install instiki directly; that will install madeleine, bluecloth, redcloth and rubyzip automatically. Last time I tried it on win32 (XP) it worked fine. [If you haven't got rpa-base installed, it might not be worth it, but it's available at http://rpa-base.rubyforge.org just in case] > PS - No offense, but I hate using a wiki to post bug reports, so > that's why I'm posting here. There were some talks in #rubyonrails about creating a bug tracker in rails. Instiki's site might provide that too in the future :-) -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch diff -ru -x svn instiki-0.9.1.orig/app/controllers/wiki.rb instiki-0.9.1/app/controllers/wiki.rb --- instiki-0.9.1.orig/app/controllers/wiki.rb 2004-08-13 17:40:55.000000000 +0200 +++ instiki-0.9.1/app/controllers/wiki.rb 2004-07-27 19:17:15.000000000 +0200 @@ -2,7 +2,9 @@ require "redcloth_for_tex" class WikiController < ActionControllerServlet - EXPORT_DIRECTORY = File.dirname(__FILE__) + "/../../storage/" unless const_defined?("EXPORT_DIRECTORY") + if defined? $EXPORT_DIRECTORY + EXPORT_DIRECTORY = $EXPORT_DIRECTORY + end def index if web_address @@ -387,4 +389,4 @@ $stderr << "#{@req.meta_vars['HTTP_X_FORWARDED_FOR']} || #{@req.meta_vars['REMOTE_ADDR']}" @req.meta_vars["HTTP_X_FORWARDED_FOR"] || @req.meta_vars["REMOTE_ADDR"] end -end \ No newline at end of file +end diff -ru -x svn instiki-0.9.1.orig/instiki.rb instiki-0.9.1/instiki.rb --- instiki-0.9.1.orig/instiki.rb 2004-08-13 17:40:55.000000000 +0200 +++ instiki-0.9.1/instiki.rb 2004-07-27 19:17:15.000000000 +0200 @@ -6,9 +6,12 @@ end require 'optparse' +require 'rpa/defaults' +require 'rpa' +RPA.version = "0.0" -cdir = File.expand_path(File.dirname(__FILE__)) -%w( /libraries/ /app/models /app/controllers ).each { |dir| $:.unshift(cdir + dir) } +cdir = File.join(RPA::Defaults::PREFIX, RPA::Defaults::SITELIBDIR, "instiki") +%w( /libraries/ /app/models /app/controllers ).each { |dir| $:.unshift File.join(cdir, dir) } %w( web_controller_server action_controller_servlet wiki_service wiki ).each { |lib| require lib } fork_available = true @@ -23,10 +26,11 @@ OPTIONS = { :server_type => fork_available ? Daemon : SimpleServer, :port => 2500, - :storage => "#{cdir}/storage", + :storage => "instiki/storage", :pdflatex => pdflatex_available } + ARGV.options do |opts| script_name = File.basename($0) opts.banner = "Usage: ruby #{script_name} [options]" @@ -41,7 +45,7 @@ ) { OPTIONS[:server_type] = SimpleServer } opts.on("-t", "--storage=storage", String, "Makes Instiki use the specified directory for storage.", - "Default: ./storage/[port]") { |OPTIONS[:storage]| } + "Default: #{OPTIONS[:storage]}") { |OPTIONS[:storage]| } opts.separator "" @@ -52,7 +56,11 @@ end Socket.do_not_reverse_lookup = true -WikiService.storage_path = OPTIONS[:storage] + "/" + OPTIONS[:port].to_s +require 'fileutils' +FileUtils.mkdir_p OPTIONS[:storage] +WikiService.storage_path = File.join(Dir.pwd, OPTIONS[:storage], + OPTIONS[:port]) WikiController.template_root = "#{cdir}/app/views/" +WikiController.const_set("EXPORT_DIRECTORY", File.join(Dir.pwd, OPTIONS[:storage]) + "/") -WebControllerServer.new(OPTIONS[:port], OPTIONS[:server_type], "#{cdir}/app/controllers/") \ No newline at end of file +WebControllerServer.new(OPTIONS[:port], OPTIONS[:server_type], "#{cdir}/app/controllers/") --mP3DRpeJDSE+ciuQ--