NOTE : the latest version of ruote (2.1) is documented at http://ruote.rubyforge.org. Meet you there.

Tokyo Cabinet / Tyrant install

Tokyo Cabinet / Tyrant are two nifty pieces of software. The simplest way of getting the latest of and best version of time is by downloading the source and compiling it.

MacPorts come with an older version of Tokyo Cabinet and no copy of Tokyo Tyrant (well, at least the MacPorts on my mac). Since compiling is very easy (and fast). I tend to go from the source instead of using a binary package. My debian box apt-get doesn’t seem to know anything about Tyrant or Cabinet.

(Note for Mac users, the compiling step requires the installation of XCode, it’s on the install CD/DVD that comes with the Mac).

Tokyo Tyrant depends on Tokyo Cabinet. Compile and install Cabinet first.

If you don’t need Tokyo Tyrant (no remote access needed), feel free to just install Tokyo Cabinet.

There is also an excellent howto from Plurk/Lightcloud at http://opensource.plurk.com/LightCloud/Installation/

getting the source

via http://1978th.net

- Tokyo Cabinet
- Tokyo Tyrant
- Tokyo Dystopia

tar xzvf tokyocabinet-1.4.36.tar.gz
tar xzvf tokyotyrant-1.1.37.tar.gz

(version numbers will probably change)

compiling and installing

cd tokyo-cabinet/
./configure
make
sudo make install

and

cd tokyo-tyrant/
./configure
make
sudo make install

Once install is done, the Cabinet tools and the Tyrant server and tools will be present on your system.

Tyrant and Lua

Lua is a very compact and attractive scripting language (http://www.lua.org). Hirabayashi-san has integrated it into Tokyo Tyrant.

In order to enable those Lua extensions, you have to make sure Lua > 5.1.0 is available on your system. Then compile and install Tokyo Tyrant with :

cd tokyo-tyrant/
./configure --enable-lua
make
sudo make install

On my Mac, the Lua 5.1.4 installed via “sudo port install lua” failed me. After tinkering a bit with —with-lua=DIR, I downloaded lua, compiled it and installed it (/usr/local/bin) and then —enable-lua worked ‘out of the box’.

Lua 5.1.4 is available at http://www.lua.org/ftp/lua-5.1.4.tar.gz then

tar xzvf lua-5.1.4.tar.gz
cd lua-5.1.4
make macosx
sudo make install

Then onto Tokyo Tyrant configure/make/sudo make install.

uninstalling

If you don’t need Tokyo Cabinet or Tyrant, it’s easy to come back in the build directory and to run “sudo make uninstall”.

cd tokyo-tyrant/
sudo make uninstall

When upgrading to a newer version of either Tokyo Cabinet or Tokyo Tyrant, this “sudo make uninstall” comes handy as well.