Instiki
Running Instiki as Ruby Gem

On Mac OS X

I have gems on my system Mac OS X (Panther 10.3.9)
To install instiki after with gems I run the following command

sudo gems instiki

This creates an instiki gem on my system found in /usr/local/lib/instiki. The inside of that file reads:
#!/usr/local/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'instiki' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'
version = "> 0" 
if ARGV.size > 0 && ARGV[0][0]==95 && ARGV[0][-1]==95
  if Gem::Version.correct?(ARGV[0][1..-2])
    version = ARGV[0][1..-2]
    ARGV.shift
  end
end
require_gem 'instiki', version
load 'instiki'

I then can run instiki as a gem by running an instiki command. However there is a problem. Running instiki command as a gem automatically creates a storage/2500 directory structure in the directory you happen to be in at the time. This looks like a general gems behavior as far as I’ve found out so we need to do something about it from creating multiple storage directories

I created a directory /Users/marekj/instiki/wiki1. This is where I will have my instiki (wiki1 as an example: you can name your wiki the way you want it). To make sure I will always run my wiki storage in this directory I created a file wiki1.sh where I put the following command.

instiki -t /Users/marekj/instiki/wiki1

Now I can run my instiki by running ‘bash wiki1.sh’. On first run Instiki will create a 2500 direcory in wiki1 where all the snapshots will be held.

Notice that your terminal windows now displays all the actions of a server. When you quit your session the server stops. I shall follow instructions on Getting Instiki to Run in the Background page but with my gems setup I created another file called wiki1nohup.sh with one line command:

nohup instiki -t /Users/marekj/instiki/wiki1 >& wiki1instiki.`date "+%Y%m%d%H%M%S"`.log &

To start Instiki as a gem in the background I just run ‘bash wiki1nohup.sh’ command and now the output is written to a log file.
To kill the server find out the pid in your log file and then run kill that pid number.
I run ‘grep pid= wiki1instiki.XX…XX.log’

Feel free to change or add to these instructions. Thanks