*Slight typo in the code fixed: 2008-01-08*
Toshiyuki and I have released a new gem called rbridge which allows us to execute functional, side-effect free, concurrent code directly in Ruby regardless of the version by using Erlang as a processor. This includes using the Mnesia distributed database and ETS/DETS.
To try it out please follow these steps:
1. Download Erlang for your os. Windows has binaries and OS X can be configured with `./configure --prefix=/opt/local` to make MacParts happy. I haven't yet tried it with Linux but the default configure options should be okay.
2. Download the rbridge gem. `sudo gem install rbridge`
3. Start the rulang server in Erlang on port 9900. Change dir to the gem directory which is usually /usr/local/lib/ruby/gems/1.8/gems/rbridge-0.1/lib and run *sudo erlc rulang.erl*. Enter the Erlang shell by typing *erl*. Finally, start the server with *rulang:start_server(9900).* (There's a dot at the end of the command).
4. Require rubygems and rbridge in your code and create a new connection to the rulang server. This is the simplest bit of inline code I can think of but there is a lot more we can do: asynchronous access and ruby-style syntax specifically.
require 'rubygems'
require 'rbridge'
@r = RBridge.new(nil, 'localhost', 9900)
puts @r.erl('10*10.')