Ever wanted your own Github-style wiki on your own mac server? Read on…

Gollum is the Git-powered wiki that is used in the Github’s wiki system. This tutorial will show you how to run it on Pow’s zero-configuration server on your mac.

Step 1: Install gollum on Ruby 1.9.2 (tried 1.8.6 with no luck)

gem install gollum

Step 2: Create a blank repository where you want to store your wiki pages. I put it in ~/Sites/wiki so i wrote:

cd ~/Sites/wiki
git init 

Step 3: in ~/Sites/wiki/ , create a config.ru file with this content in it :

require "gollum/app"

Precious::App.set(:gollum_path, File.dirname(__FILE__))
Precious::App.set(:wiki_options, {})
run Precious::App

(thanks to this thread)

Step 4: Install the “Pow” webserver:

curl get.pow.cx | sh

Step 5:

cd ~/.pow
ln -s ~/Sites/wiki

Step 6: Gollum lets you edit wiki pages with textile, markdown, Rdoc, and many others. If you want to edit your entries with Textile, you’ll need to install the RedCloth gem, like this:

gem install RedCloth

Step 7: Now, the fact that your rack app is in the wiki folder makes your app available through wiki.dev on the machine that is hosting it. BUT, if you’re like me and you need to access it from another computer in your network, then you need to get the IP address of your mac that is hosting the wiki, and add an entry like this in the /etc/hosts file on every machine that wants to access the wiki (in my case, the macmini that is hosting the wiki has 192.168.2.12):

192.168.2.12       wiki.dev

That’s it! You can now visit http://wiki.dev in your browser.

Update of July 4, 2013

Thanks to Scott for reminding me to change the require statement for "gollum/app".